Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new Android App Bundle package format #729

Closed
fortunella opened this issue May 8, 2019 · 54 comments · Fixed by #764
Closed

Support new Android App Bundle package format #729

fortunella opened this issue May 8, 2019 · 54 comments · Fixed by #764

Comments

@fortunella
Copy link

Feature Request

Motivation Behind Feature

Google recommends using the new Android App Bundle format for apps uploaded to Google Play. When you upload an APK a warning is displayed which encourages to use the newer format.

Feature Description

Google provides information on the new package format on:
https://developer.android.com/platform/technology/app-bundle
It would be great if Cordova would support this new package format out of the box or with a parameter for the build command.

@janpio
Copy link
Member

janpio commented May 8, 2019

For reference: Previous question issue about support of bundles: #610

@dpogue dpogue added this to the 9.0.0 milestone May 8, 2019
@niren777
Copy link

I'm able to generate both 32-bit and 64-bit versions using cordova build android --release and cordova build android --release --xwalk64bit respectively

As Android App Bundle package is not supported by cordova-android yet, should I upload both android-armv7-debug.apk and android-arm64-release.apk to play store to support both 32-bit and 64-bit mobiles?

By uploading both the apk files, I'll end up creating one more project for the 64-bit version and also with different version code as mentioned by android here https://developer.android.com/google/play/publishing/multiple-apks

@breautek
Copy link
Contributor

breautek commented May 30, 2019

I'm able to generate both 32-bit and 64-bit versions using cordova build android --release and cordova build android --release --xwalk64bit respectively

As Android App Bundle package is not supported by cordova-android yet, should I upload both android-armv7-debug.apk and android-arm64-release.apk to play store to support both 32-bit and 64-bit mobiles?

Because crosswalk uses native libraries, yes you will have to build a 32bit and a 64bit version of the APK and upload them both to the google play store. This is what I do for my apps currently since I haven't moved away from crosswalk yet.

@niren777
Copy link

niren777 commented May 30, 2019

@breautek Thanks for the comment.
Should I need to create another project in Google play for 64-bit version of apk? or Is one project enough to support both 32-bit and 64-bit versions?
Also should I need to generate both the apk files with different android version code?

@breautek
Copy link
Contributor

Both APKs needs to have the same package ID. So they get uploaded to the same project. When you enable multiple APKs, the build will add a digit to your versionCode to represent 32bit/64bit. Google play store will automatically select the proper APK for the device that is installing the app.

To prevent hijacking this thread, if you have anymore questions about multiple APKs you should open up a new issue.

@malvarez-troop
Copy link

malvarez-troop commented Jun 5, 2019

Hi,
We have generated the bundle with Android Studio.

The steps are:

  1. Launch Android Studio
  2. Go To Import Project (Eclipse ADT, Gradle, etc).
  3. Select Android platform directory in your project (/platforms/android).
  4. Wait for finish the Sync
  5. Go to Build > Generate Sign Bundle
  6. Complete Signing info
  7. Upload de .aab file generated (in path /platforms/android/outputs/

Note: if you have problem whith minSDK version, fix this and make a resync

@JonSmart
Copy link

JonSmart commented Jun 6, 2019

Whilst the Android Studio work around is great, I would like to integrate this with our CI Server and therefore interested to understand when the Cordova CLI can build with this output instead of APK.

@janpio
Copy link
Member

janpio commented Jun 6, 2019

We are always open for PRs from the community!

You will have to understand how the current Android build works, then see if there is an equivalent for the commands for App Bundles (vs. APKs) and then adapt these back into Cordova Android.

(https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/build, https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/Api.js#L253-L314 and https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/lib/build.js will probably be your starting point, on to https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/lib/builders/ProjectBuilder.js which seems to do the actual building - if you have any questions or need help, feel free to ping me here or on slack.cordova.io)

@PavlosIsaris
Copy link

Hi,
We have generated the bundle with Android Studio.

The steps are:

  1. Launch Android Studio
  2. Go To Import Project (Eclipse ADT, Gradle, etc).
  3. Select Android platform directory in your project (/platforms/android).
  4. Wait for finish the Sync
  5. Go to Build > Generate Sign Bundle
  6. Complete Signing info
  7. Upload de .aab file generated (in path /platforms/android/outputs/

Note: if you have problem whith minSDK version, fix this and make a resync

What android-cordova version did you use to do that? Didn't you have a problem with the android-gradle plugin version?

@fabiodiniz
Copy link

Now I can't upload a new app to Play Store. The warning is not allowing me to send it to production. It suggests to generate an Android App Bundle.

image

image

@anh1979
Copy link

anh1979 commented Jun 13, 2019

We are facing the same problem right now. Just as @JonSmart wrote above, a solution to integrate this with CI Servers is required in our scenario, as we are working with a great number of apps in an automated process.

Please prioritize, if at all possible.

@janpio
Copy link
Member

janpio commented Jun 13, 2019

@anh1979 As I wrote before we are happy to review any Pull Requests done by the community.

@GuilhermeLessa
Copy link

GuilhermeLessa commented Jun 13, 2019

Now I can't upload a new app to Play Store. The warning is not allowing me to send it to production. It suggests to generate an Android App Bundle.

image

image

These warnings do not block the submission of the app. They are only warnings of recommendations. Check other pending items in the left side menu. Play Console is not very intuitive.

@fabiodiniz na verdade esses avisos são somente avisos, eles não estão impedindo você de lançar para produção. Você consegue enviar para produção subindo os .apk's como sempre. Veja os itens do menu esquerdo, todos devem estar "checkados" (verdes). O que acontece é que você deve ter itens pendentes de revisão nesse menu.

@fabiodiniz
Copy link

fabiodiniz commented Jun 13, 2019

@fabiodiniz na verdade esses avisos são somente avisos, eles não estão impedindo você de lançar para produção. Você consegue enviar para produção subindo os .apk's como sempre. Veja os itens do menu esquerdo, todos devem estar "checkados" (verdes). O que acontece é que você deve ter itens pendentes de revisão nesse menu.

@GuilhermeLessa vc tem razão amigo, confusão minha aqui, valeu 🙏

These warnings do not block the submission of the app. They are only warnings of recommendations. Check other pending items in the left side menu. Play Console is not very intuitive.

Yeah, u're right. My mistake 😳

@jfoclpf
Copy link

jfoclpf commented Jun 23, 2019

Hi,
We have generated the bundle with Android Studio.

The steps are:

  1. Launch Android Studio
  2. Go To Import Project (Eclipse ADT, Gradle, etc).
  3. Select Android platform directory in your project (/platforms/android).
  4. Wait for finish the Sync
  5. Go to Build > Generate Sign Bundle
  6. Complete Signing info
  7. Upload de .aab file generated (in path /platforms/android/outputs/

Note: if you have problem whith minSDK version, fix this and make a resync

Any way of doing it only with command line using adb?
I would add it to my building script saving a lot of time

@viktor-shmigol
Copy link

@jfoclpf I got it working on circle ci.

The steps are:

1 - run:
      name: Build android!
      command: 'ionic cordova build android --prod --release'

2  - run:
      name: Build an app bundle
      command: 'cd /Users/test_user/project/platforms/android && ./gradlew bundle'
3 - run:
      name: Signing an app bundle
      command: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /Users/test_user/project/sign/my_key.keystore /Users/test_user/project/platforms/android/app/build/outputs/bundle/release/app.aab todoapp -storepass my_password

4 - Upload app.aab to google play.

@lucasbasquerotto
Copy link

Thanks, @viktor-shmigol, I was able to generate an aab file that way. The only thing, though, is that the reduction in size is almost negligible in my case (from 12.8MB to 11.8MB).

@breautek
Copy link
Contributor

breautek commented Jul 3, 2019

The aab file size is not the served file size. Google Play store will tell you what will be the approximate served file sizes for each device configuration when you upload the aab file.

@dpogue
Copy link
Member

dpogue commented Jul 3, 2019

Speaking realistically, you’re not going to see much (any?) size savings for Cordova apps because the majority of the size is the web content assets and Google can’t strip any of that out.

@krunal9421
Copy link

@breautek
I have query regarding 30th May comment that we will have two different upload provision by Google for 64 and 32 bit apps?
And do we need to two different apps with same or different android android-versionCode for release?
because Ionic does not have any cli to build 64bit apk.
Can you help me with this?

@janpio
Copy link
Member

janpio commented Jul 13, 2019

@krunal9421 Please open a new issue or better Stack Overflow question about this and don't derail this issue. Thanks.

@jsaraiva
Copy link

@jfoclpf I got it working on circle ci.

The steps are:

1 - run:
      name: Build android!
      command: 'ionic cordova build android --prod --release'

2  - run:
      name: Build an app bundle
      command: 'cd /Users/test_user/project/platforms/android && ./gradlew bundle'
3 - run:
      name: Signing an app bundle
      command: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /Users/test_user/project/sign/my_key.keystore /Users/test_user/project/platforms/android/app/build/outputs/bundle/release/app.aab todoapp -storepass my_password

4 - Upload app.aab to google play.

Hello.

The instructions above are right on the money.
Furthermore, and in case this helps anyone:
You can skip the signing step itself. If you add a build.json file to your project with the release signing info (see https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#using-buildjson), then this will automatically generate a release-signing.properties file, which in turn will be used by the Gradle tasks (including the task to build the bundle). So, step 3 can be sidestepped entirely.
Also, running the gradlew "bundle" task generates bundles for both debug and release. If you want to only generate the release version, use "bundleRelease" (or "bundleDebug" to get the debug version).

Cheers!

@khoabuidev
Copy link

@jfoclpf I got it working on circle ci.

The steps are:

1 - run:
      name: Build android!
      command: 'ionic cordova build android --prod --release'

2  - run:
      name: Build an app bundle
      command: 'cd /Users/test_user/project/platforms/android && ./gradlew bundle'
3 - run:
      name: Signing an app bundle
      command: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /Users/test_user/project/sign/my_key.keystore /Users/test_user/project/platforms/android/app/build/outputs/bundle/release/app.aab todoapp -storepass my_password

4 - Upload app.aab to google play.

Thanks so much, working perfectly.

@dpa99c
Copy link

dpa99c commented Jul 29, 2019

Speaking realistically, you’re not going to see much (any?) size savings for Cordova apps because the majority of the size is the web content assets and Google can’t strip any of that out.

@dpogue That's true for a very simple Cordova app, but if you start including plugins with native SDKs that contain architecture-specific compiled C libraries, then the app bundle starts to pay off since it only distributes the library variants specific to the device architecture rather than the library variant for every architecture (as a multi-arch APK does).

@geeksilva97
Copy link

@jfoclpf I got it working on circle ci.

The steps are:

1 - run:
      name: Build android!
      command: 'ionic cordova build android --prod --release'

2  - run:
      name: Build an app bundle
      command: 'cd /Users/test_user/project/platforms/android && ./gradlew bundle'
3 - run:
      name: Signing an app bundle
      command: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /Users/test_user/project/sign/my_key.keystore /Users/test_user/project/platforms/android/app/build/outputs/bundle/release/app.aab todoapp -storepass my_password

4 - Upload app.aab to google play.

This sounds awesome! But didn't work for me. When I run the ./gradlew bundle I'm getting the following output:

`

Configure project :CordovaLib
publishNonDefault is deprecated and has no effect anymore. All variants are now published.

Configure project :app
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_1je5gdx9ebu802xao0249llns.run(/home/edy/workspaces/tutoriais/ionic/shareApp/platforms/android/app/build.gradle:143)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.

FAILURE: Build failed with an exception.

  • What went wrong:
    Task 'bundle' is ambiguous in root project 'android'. Candidates are: 'bundleAppClassesDebug', 'bundleAppClassesDebugAndroidTest', 'bundleAppClassesDebugUnitTest', 'bundleAppClassesRelease', 'bundleAppClassesReleaseUnitTest', 'bundleDebug', 'bundleRelease'.

  • Try:
    Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 7s
`

@breautek
Copy link
Contributor

breautek commented Aug 1, 2019

Running the normal build command once should install gradlew for you.

@geeksilva97
Copy link

geeksilva97 commented Aug 1, 2019

Awesome! With your help I got it. Thank you all.

To generate gradlew I executed the command

$ ./gradle wrapper --gradle-version=5.5.1 --distribution-type=bin

This generated to me a folder with gradlew.bat.

After I executed the command ./gradlew bundleDebug and it worked! My .aab file was generated.

@geeksilva97
Copy link

geeksilva97 commented Aug 1, 2019

Running the normal build command once should install gradlew for you.

Oh my God! I went the long way. Thank you!

@breautek
Copy link
Contributor

breautek commented Aug 1, 2019

Oh my God! I went the long way. Thank you!

Doesn't hurt to know what goes on behind the scenes ;)

@tomriddle1234

This comment has been minimized.

@Clint258
Copy link

C:\Users\User\Desktop\UPKwiK\platforms>cd /Users/user/desktop/upkwik/platforms/android && ./gradlew bundle
'.' is not recognized as an internal or external command,
operable program or batch file.

please help me

Capture

@breautek
Copy link
Contributor

breautek commented Sep 12, 2019

C:\Users\User\Desktop\UPKwiK\platforms>cd /Users/user/desktop/upkwik/platforms/android && ./gradlew bundle
'.' is not recognized as an internal or external command,
operable program or batch file.

please help me

Capture

Window users have to use gradlew.bat instead of gradlew.

@dpogue
Copy link
Member

dpogue commented Sep 12, 2019

Also, cordova-android@8.1.0 has been released, which includes bundle support. With 8.1.0 installed, you can use cordova build android --release -- --packageType=bundle to build bundles. (note the double set of -- -- hyphens)

cordova-android@8.1.0 has not been released, it has been tagged to begin the release voting process. It will be published to npm when it has been released.

@breautek
Copy link
Contributor

Also, cordova-android@8.1.0 has been released, which includes bundle support. With 8.1.0 installed, you can use cordova build android --release -- --packageType=bundle to build bundles. (note the double set of -- -- hyphens)

cordova-android@8.1.0 has not been released, it has been tagged to begin the release voting process. It will be published to npm when it has been released.

My bad, I edited my comment to avoid confusion.

@Clint258
Copy link

Clint258 commented Sep 14, 2019 via email

@geeksilva97
Copy link

geeksilva97 commented Sep 14, 2019

To help more people I made a short series of videos on YouTube. In these three videos I show you how you can build your app.

Check out

https://www.youtube.com/playlist?list=PLfeu5i2CGb0uJeI8NshaN1TLXy1eJg2No

I hope this can help.

@Clint258
Copy link

Clint258 commented Sep 15, 2019 via email

@Clint258
Copy link

Clint258 commented Sep 15, 2019 via email

@geeksilva97
Copy link

Sim. Podemos chegar a solução. O que está havendo?

@Clint258
Copy link

Clint258 commented Sep 15, 2019 via email

@timbru31
Copy link
Member

timbru31 commented Sep 15, 2019

Guys, these seems a) off topic and b) please stick to English
You might want to continue this chat on a more suitable platform than a closed GitHub issue :)
Thanks!

@timbru31 timbru31 removed this from the 9.0.0 milestone Sep 15, 2019
@Clint258
Copy link

Clint258 commented Sep 16, 2019 via email

@rushdone
Copy link

rushdone commented Oct 10, 2019

@fabiodiniz, i got same problem with you about that warning sign..may know what mistake did u noticed until u can publish without using android app bundle?

@breautek
Copy link
Contributor

breautek commented Oct 10, 2019

@fabiodiniz, i got same problem with you about that warning sign..may know what mistake did u noticed until u can publish without using android app bundle?

Google does not prevent you from publishing APKs. I still do this in my personal projects. Google however, does require you to supply an APK that contains the 64bit architecture of native libraries, if you're app includes native libraries.

You can either do this by including all architectures you support in a single APK or by using a multi-apk setup where each APK is for a specific architecture.

Google encourages you to include all shared library architectures in a form of a bundle. This would be best deployment strategy moving forward, but they don't stop you from using an any of the APK deployment strategies.

@desmeit
Copy link

desmeit commented Oct 21, 2019

I tried with 8.1.0:

cordova build android --release
cd platforms/android
./gradlew bundleRelease

But I get an error:

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see:     http://d.android.com/r/tools/update-dependency-configurations.html
An exception occurred while trying to find the Android build tools.
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Script '/XXX/platforms/android/CordovaLib/cordova.gradle' line: 121

* What went wrong:
A problem occurred evaluating project ':app'.
> Unable to determine Android SDK directory.

What could be the reason?

@breautek
Copy link
Contributor

@desmeit cordova cannot find your android sdk directory, so you might have a misconfiguration somewhere.

Please open a new issue and fill out the form appropriately as it will tell us everything we will need to know to further help you. You may even find the problem yourself in the process.

Thanks.

@andriimanundin27
Copy link

after update to cordova-android 8.0.0
then run
cordova build android --release

But I get an error

> Task :app:fabricGenerateResourcesArm64Release FAILED
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: null.
Check the Crashlytics plugin to make sure that the application has been added successfully!
Contact support@fabric.io for assistance.
        at com.crashlytics.tools.android.DeveloperTools.processApiKey(DeveloperTools.java:375)
        at com.crashlytics.tools.android.DeveloperTools.processProperties(DeveloperTools.java:517)
        at com.crashlytics.tools.android.DeveloperTools.processArgsInternal(DeveloperTools.java:348)
        at com.crashlytics.tools.android.DeveloperTools.gradleMain(DeveloperTools.java:292)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:91)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
        at com.crashlytics.tools.gradle.tasks.FabricTaskBuilder.callDevtoolsWrappingRuntimeExceptions(FabricTaskBuilder.groovy:359)
        at com.crashlytics.tools.gradle.tasks.FabricTaskBuilder.this$2$callDevtoolsWrappingRuntimeExceptions(FabricTaskBuilder.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:352)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:169)
        at com.crashlytics.tools.gradle.tasks.FabricTaskBuilder$_pluginGenerateResources_closure4.doCall(FabricTaskBuilder.groovy:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at groovy.lang.Closure.call(Closure.java:418)
        at groovy.lang.Closure.call(Closure.java:434)
        at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:739)
        at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:712)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
        at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#sec:command_line_warnings
28 actionable tasks: 2 executed, 26 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:fabricGenerateResourcesArm64Release'.
> Crashlytics Developer Tools error.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 4s
C:\Users\JAKPAT\Documents\mulaikerja\cabaca\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:fabricGenerateResourcesArm64Release'.
> Crashlytics Developer Tools error.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 4s

@danielo515
Copy link

@jfoclpf I got it working on circle ci.

The steps are:

1 - run:
      name: Build android!
      command: 'ionic cordova build android --prod --release'

2  - run:
      name: Build an app bundle
      command: 'cd /Users/test_user/project/platforms/android && ./gradlew bundle'
3 - run:
      name: Signing an app bundle
      command: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /Users/test_user/project/sign/my_key.keystore /Users/test_user/project/platforms/android/app/build/outputs/bundle/release/app.aab todoapp -storepass my_password

4 - Upload app.aab to google play.

This is exactly what I needed. Worked like a charm on github actions (with some minnor modifications)

@brodybits
Copy link
Contributor

@jfoclpf I got it working on circle ci.

The steps are:
[...]

It would be nice if we could get this documented somewhere.

@breautek
Copy link
Contributor

breautek commented Jul 8, 2020

It would be nice if we could get this documented somewhere.

Shouldn't be necessary to go into platforms/android and run gradle commands manually. cordova build android --release -- --packageType=bundle should build the bundle, or you can specify packageType in the build.json file. This is documented, but not published on the website yet. If something on this doesn't work properly, then a new issue should be raised.

From what I can see looking at the history of this discussion, looks like most users were either using frameworks that doesn't allow you to pass down this flag, or they were using a version pre 8.1.0, which is the version that introduced bundle support (hence the need to use gradle manually for those users)

@apache apache locked as resolved and limited conversation to collaborators Jul 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.