How to solve release is not compliant with the Google Play 64-bit requirement in flutter
This is my first post after exploring the Google Flutter framework for developing the cross platform apps in this framework. I am fascinated by the ease and simplicity of creating the UI in Dart programming. I will share my experience and the error and workaround that I went through while releasing a small size apk on play store.
This release is not compliant with the Google Play 64-bit requirement in flutter.
All is well that ends well.
This proverb means lot to me as a developer because we have to showcase the world what we have developed in the app from play store and this doesn’t happen to me and I wasted a whole day dealing with this.
After following the steps described here in https://flutter.dev/docs/deployment/android
You have two possible release formats when publishing to the Play Store.
- App bundle (preferred)
I ignored the note as I always do as a native Android app developer I always release .apk on play store console. So I will describe the steps that leads to the problem and then quickly I will reveal the solution to this issue.
Whenever we build a release apk with this command:
flutter build apk –release
Now there is nothing wrong in this command but this command generates a Fat apk which contains the resources. let say approx for example 16 MB (for my app)
What is a fat APK?
A fat APK is a single APK that contains binaries for multiple ABIs embedded within it. This has the benefit that the single APK runs on multiple architectures and thus has wider compatibility, but it has the drawback that its file size is much larger, causing users to download and store more bytes when installing your application.
Another option is to generate apk per ABIs using this command:
flutter build apk –split-per-abi
This command results in two APK files:
Now going by this approach in my case these two apks were of 6 MB approx(for my app).
Wow. How this happened !!
There is no magic behind this if you have used Realm.io then also you have faced similar issue of app size increased significantly, and we are left with no other option to release multiple apks on play store for each architecture(ABIs). ==============We will talk later about this in same post.
Now the situation here is how you can upload these two apks for each release. In earlier days we have the advanced mode in Google developer console
But now you will not find this in your account.
Problem: Upload two apks for same version (1.0.0) for two different architecture.
Most of the solutions related to these questions on stackoverflow are related to switching to advanced mode and upload multiple apks but guess what this is no longer available.
MANUAL APPROACH:(NOT RECOMMENDED)
Solution for now is this: Go to
flutter build apk --release --target-platform=android-arm
app-armeabi-v7a-release.apk to the play store
I am using VS code and from there I have incremented the version code like this:
version:1.0.0+1( for first apk) and change/increment version:1.0.0+2 (for second apk).
flutter build apk --release --target-platform=android-arm64
app-arm64-v8a-release.apk to the play store.
Now in playstore console you can select artifacts library and you can see two apks with version code 1 and version code 2.
Now go ahead and release both the apks . Play store will automatically serve the apk files based on the users android phone architecture.
You remember about the note that Flutter recommended
We just have to release .aab (Android App bundle) its not a new things and guess what our life will be too easy with this bundle. Because play store automatically generates the apk files from this .aab file. How playstore does that ?
Before release, you can install the bundle tools and can generate the apks from bundle tool command line options by following steps from here
Now you just deploy one single .aab file . No need to follow manual method of uploading a separate apk after incrementing version code and all those long process. I would recommend going with .aab file.
Check this link:
Please suggest or comment if you have better thing to share or improve this post.
Ravi Yadav is an Android developer whose passion is to develop Android applications and sharing his work. He loves to post the tutorials which he created while learning any new latest technology topic.He loves to share about the latest technology happenings and other tricks that will be helpful for readers of Askfortricks.