How to generate android app bundle for ionic 3 application

Hii guys,
i have generated the apk using command :
ionic cordova build android --prod --release
after that i have generated key for playstore using command:
keytool -genkey -v -keystore myapp-release-key.keystore -alias com.exel.myapp -keyalg RSA -keysize 2048 -validity 10000

later i have signed using jarsigner using command:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore myapp-release-key.keystore platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk com.exel.myapp

finally i am budling using zipalign using command:
C:\Users\Exel\AppData\Local\Android\sdk\build-tools\29.0.0\zipalign -v 4 platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk myapp-release-signed.apk

when i am uploading the apk to play store it’s giving warning like unoptimised code “please bundle using android app bundle”. when i am trying to do android app bundle using android studio 3.4.1 .it’s giving me warning like “Android Gradle Plugin version should be more than 3.2 or higher” .when i am clicking update button it’s getting dismissed and continuosly showing the same message every time .

so, i need suggestion and solution for this problem .i will be very thankful to this forum ,if i am able to fix this with your help.

1.On Play we have option whether to upload bundle or not first that you need to check
2.Try to create app on google console with scratch to that you can opt out to upload bundle.

if you don’t mind can you share the screenshot or steps .because i am doing this first time .any help will be appreciated…

@Subodh18 Please take a look at my comment: https://github.com/apache/cordova-android/issues/729#issuecomment-507569844

1 Like

Hi folks,
figured it out to generate the .aab file as described here, and upload to Play Console and processing there is fine, BUT…
We are now encountering an “error_connection_refused” exception on app start, when the app ist installed either via app from .aab over bundle tool or via google play console.
Edit - no longer the case: And also the app has wrong icons in the home screen of the device.

Why these differences?
Ideas anyone? Help is greatly appreciated.

Anne

thanks viktor .i have rollout the release signed apk for production.it’s worked fine .i will try your suggestion .that’s great for me.

1 Like