When I run flutter build apk --split-per-abi
I get three apks twice: once under the directory build/app/outputs/apk/release and once under build/app/outputs/flutter-apk. What is the difference between these two directories?
Major differences are the debug apk and the release apk: For debug builds the apk will be signed with the default debug signing keys with debug flag enabled. For release apk you will have to explicitly specify the apk to sign with and the debug flag will be turned off so that it cannot be debugged.
To compile in release mode, we just need to add the --release flag to the flutter run command and have a physical device connected. Although we can do so, we typically do not use the flutter run command with the --release flag.
The fat apk that you are getting while using the flutter build apk contains the necessary compiled code to target all the Application Binary Interfaces or ABIs. Once a user downloads this fat apk, then only the code applicable to the device will be used. Show activity on this post.
The command flutter build apk --split-per-abi typically generates two APK files. arm64 or x86_64 is the apk file for devices having 64-bit processors. x86 is the apk file for 32-bit processors. You can upload both of them on the PlayStore and based on the user's device architecture the corresponding apk will be installed.
By default, the app bundle contains your Dart code and the Flutter runtime compiled for armeabi-v7a (ARM 32-bit), arm64-v8a (ARM 64-bit), and x86-64 (x86 64-bit). Show activity on this post. Remember that creating an App Bundle (an .aab file) is preferred over creating a fat APK or multiple APKs per abi.
During a typical development cycle, you test an app using flutter run at the command line, or by using the Run and Debug options in your IDE. By default, Flutter builds a debug version of your app. When you’re ready to prepare a release version of your app, for example to publish to the Google Play Store , this page can help.
They are the same. Old version of flutter use outputs/apk/release
directory but they changed it to outputs/flutter-apk
recently. The old directory is kept for compatibility with other building tools.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With