I am trying to generate a release apk file using Cordova 11 with the build.json file. Cordova generates an AAB file instead of an APK file. Here is the command I have used:
cordova build android --release
I am trying to generate a release apk file using Cordova 11 with the build.json file. Cordova generates an AAB file instead of an APK file. Here is the command I have used:
cordova build android --release
Finally, I have the answer! Use:
cordova build android --release -- --packageType=apk
Got this answer from a youtube user called Harag. Thank you Harag.
cordova build android --release -- --packageType=apk
) but still got .aab file 😞 –
Permute --
twice, like npx quasar build -m cordova -T android -- -- --packageType=apk
–
Fredrick Build with cordova command:
cordova build android --packageType=apk
It will create .apk in debug mode and depending on cordova version in release. You can also create .aab and use bundletool (see android bundletool) to extract apks like this:
bundletool build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks
--release
flag and it gave me: platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk
–
Sarette If you're on a Windows machine, the following is what worked for me:
Ionic:
ionic cordova build android --release "--" "--" --packageType=apk
Non-Ionic:
cordova build android --release "--" "--" --packageType=apk
The secret is to escape the --
. I got this answer straight from the Cordova Support: Generate .apk instead of .aab file (Ionic Project) #1671
cordova build android --release "--" --packageType=apk
(note the single "--"
instead of the two suggested in this post). –
Mcdougal Confirming that the command that produced .apk is
cordova build android --release -- --packageType=apk
I am using ionic with cordova, I am able to generate apk using -- twice
ionic cordova build android --prod --release -- -- --packageType=apk
For this issue iam use below command, this was worked for me.
cordova build android --packageType=apk
© 2022 - 2025 — McMap. All rights reserved.