Unable to upload APK on play console getting (Upload a valid app bundle) issue - flutter

Viewed 12867

I am getting an error while uploading apk to play console for first time. I have released 2 apps with same account and did not get any error, but this is the 3rd app and it is working fine on each mode (--release, --debug, --profile). I am building apk in flutter using --dart-define using the following command

flutter build apk --release --split-per-abi --no-tree-shake-icons --dart-define=ID=1234 --dart-define=APP_NAME=test_app --dart-define=APP_SUFFIX=.test

below is issue screenshot enter image description here

5 Answers

You are uploading a .apk file in Google Play Console but you have to upload the .aab App Bundle file.

Google Play store simply does not accepts APK anymore for publishing the apps, you have to upload the bundle of the Android app.

For reference

For Native Android
Android Studio-> Build-> Generate Signed Bundle /APK...

enter image description here

For Flutter See this and dev doc

From the command line:

Enter cd [project]
Run flutter build appbundle
(Running flutter build defaults to a release build.)

I was not aware of google is stop accepting APK's for new app from august 2021 for reference please visit - reference

flutter build appbundle --no-tree-shake-icons --dart-define=ID=1234 --dart-define=APP_NAME=test_app --dart-define=APP_SUFFIX=.test

this worked for me

You are required to upload an App Bundle, not the APK.

from developer console,

Important: From August 2021, new apps are required to publish with the Android App Bundle on Google Play. New apps larger than 150 MB are now supported by either Play Feature Delivery or Play Asset Delivery.

You can read more about this at Android Developer Console.

You can use the below command to create an appBundle in flutter,

flutter build appbundle

Read more about Android deployment at Flutter Docs

Yes. Now it is mandatory to upload .aab file instead of .apk file on Google play store. To Generate .aab file, please follow given steps.

  1. Go to Build -- from top bar in Android studio
  2. Click Generate Signed Bundle / Apk
  3. Select Android App Bundle then Click Next
  4. tick the check box for Export then Next
Related