You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Morgs007 (via GitHub)" <gi...@apache.org> on 2023/10/04 22:13:11 UTC
[I] Generate .apk instead of .aab file (Ionic Project) [cordova-android]
Morgs007 opened a new issue, #1671:
URL: https://github.com/apache/cordova-android/issues/1671
# Bug Report
I am trying to generate a .apk file but whatever command I try I keep getting a .aab file. What is the new command to use in order for one to successfully generate a .apk file?
## Problem
I used the following commands to no success:
- `ionic cordova build android --release --packageType=apk`
- `ionic cordova build android --prod --release -- --packageType=apk`
- `cordova build android --release -- --packageType=apk`
- `cordova build android --prod --release -- -- --packageType=apk`
### What is expected to happen?
Produce a .apk file
### What does actually happen?
All the commands produces a .aab file
### Command or Code
`ionic cordova build android --release --packageType=apk`
`ionic cordova build android --prod --release -- --packageType=apk`
`cordova build android --release -- --packageType=apk`
`cordova build android --prod --release -- -- --packageType=apk`
### Version information
Cordova Platforms : android 12.0.1
Cordova CLI : 12.0.0 (cordova-lib@12.0.1)
Ionic CLI : 6.20.8
@angular-devkit/build-angular : 15.2.7
@angular-devkit/schematics : 15.2.7
@angular/cli : 15.2.7
@ionic/angular-toolkit : 9.0.0
native-run : 1.7.2
Android SDK Tools : 26.1.1
NodeJS : v18.16.1
npm : 9.6.0
OS : Windows 10
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Generate .apk instead of .aab file (Ionic Project) [cordova-android]
Posted by "Morgs007 (via GitHub)" <gi...@apache.org>.
Morgs007 commented on issue #1671:
URL: https://github.com/apache/cordova-android/issues/1671#issuecomment-1748935765
Thanks for your help
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Generate .apk instead of .aab file (Ionic Project) [cordova-android]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1671:
URL: https://github.com/apache/cordova-android/issues/1671#issuecomment-1747737212
The Cordova CLI uses `cordova build android --release -- --packageType=apk`.
I can't speak for third-party CLI's like ionic and all information below is assuming pure cordova environment.
On windows, if you're using Command Prompt or Powershell, I think the intermediate `--` needs to be in quotations: `cordova build android --release "--" --packageType=apk`, for the shell to properly pass-through the arguments
Also note that I believe the build output will print out all apks/bundles thats in your build output directory. So it will include text stating that it "built" a file even if that file wasn't actually built from your last command, but purely because the file already existed in the build/outputs directories.
In otherwords, you should see the APK in `platforms/android/app/build/outputs/apk/release/` and you should see that printout, but you may also (incorrectly) see printouts about it building `aab` files as well. This might be a source of confusion.
The command hasn't changed since it was first introduced in v10 and building both AABs and APKs is part of my workflow so I'm pretty confident it works (On Linux/Mac machines anyway). Let me know if this helps.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Generate .apk instead of .aab file (Ionic Project) [cordova-android]
Posted by "Morgs007 (via GitHub)" <gi...@apache.org>.
Morgs007 commented on issue #1671:
URL: https://github.com/apache/cordova-android/issues/1671#issuecomment-1748864115
@breautek that worked, thanks a lot. I see a lot of people are complaining about the same issue on stackoverflow so I will go and answer using your recommendation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Generate .apk instead of .aab file (Ionic Project) [cordova-android]
Posted by "Morgs007 (via GitHub)" <gi...@apache.org>.
Morgs007 commented on issue #1671:
URL: https://github.com/apache/cordova-android/issues/1671#issuecomment-1748803775
> The Cordova CLI uses `cordova build android --release -- --packageType=apk`.
>
> I can't speak for third-party CLI's like ionic and all information below is assuming pure cordova environment.
>
> On windows, if you're using Command Prompt or Powershell, I think the intermediate `--` needs to be in quotations: `cordova build android --release "--" --packageType=apk`, for the shell to properly pass-through the arguments
>
> Also note that I believe the build output will print out all apks/bundles thats in your build output directory. So it will include text stating that it "built" a file even if that file wasn't actually built from your last command, but purely because the file already existed in the build/outputs directories.
>
> In otherwords, you should see the APK in `platforms/android/app/build/outputs/apk/release/` and you should see that printout, but you may also (incorrectly) see printouts about it building `aab` files as well. This might be a source of confusion.
>
> The command hasn't changed since it was first introduced in v10 and building both AABs and APKs is part of my workflow so I'm pretty confident it works (On Linux/Mac machines anyway). Let me know if this helps.
See below screenshot of what I am talking about:

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Generate .apk instead of .aab file (Ionic Project) [cordova-android]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1671:
URL: https://github.com/apache/cordova-android/issues/1671#issuecomment-1748814967
Can you try `cordova build android --release "--" --packageType=apk` ?
I don't use windows so I kinda forget but I'm pretty sure windows requires that separating `--` to be enclosed quotations like above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Generate .apk instead of .aab file (Ionic Project) [cordova-android]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1671:
URL: https://github.com/apache/cordova-android/issues/1671#issuecomment-1748911089
I've created a ticket on the docs repo (https://github.com/apache/cordova-docs/issues/1336) as well, so that we can improve our docs on this caveat.
I'm closing this issue because it's not really a bug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Generate .apk instead of .aab file (Ionic Project) [cordova-android]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek closed issue #1671: Generate .apk instead of .aab file (Ionic Project)
URL: https://github.com/apache/cordova-android/issues/1671
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org