how delete architecture in flutter apk

Viewed 407

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

2 Answers

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.

in ../android/app/build.gradle add the lines

android {
   ...
   defaultConfig {
       ...  
       ndk {
          abiFilters "armeabi-v7a", "arm64-v8a"
       }
   }
}

built for all architectures by default

Related