Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
495 views
in Technique[技术] by (71.8m points)

dart - how delete architecture in flutter apk

I'm making an app on flutter(i'm a rookie on this language), and i see on the lib folder of the app 6 architectures x86, x86_64, mips, armeabi, armeabi-v7a, arm64_v8a but to upload on the playstore just need 2 armeabi-v7a and arm64_v8a. my question is, how can i compile the app without the other 4 architectures to reduce the size of the app because with the 6 folders it is 140MB?

p/s: English is not my natural lenguaje

question from:https://stackoverflow.com/questions/65884739/how-delete-architecture-in-flutter-apk

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Looks like you're only doing flutter build hence, you're getting so many builds.

Here's what you can do,

  • if you're building for a play store, the recommended way to do is by building an appBundle which you can refer how to here

  • you can try flutter build apk --split-per-abi which will produce only 3 versions arm64-v8a, armeabi-v7a and x86 so you can extract the two and upload.

  • Additionally, you can build for only specific platforms by using this command

flutter build apk --target-platform android-arm64,android-arm --split-per-abi

refer this for more information on splitting.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...