Hi guys,
I am getting following error when trying bundle the universal APKs from . aab (v1.9.2) during the deploy-to-bitrise-io step.
The log was printed as below:
java "-jar" "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/tool838238510/bundletool-all-0.9.0.jar" "build-apks" "--mode=universal" "--bundle" "/Users/vagrant/deploy/app-debug.aab" "--output" "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/aab-bundle807550645/universal.apks" "--ks" "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/aab-bundle807550645/debug.keystore" "--ks-pass" "pass:android" "--ks-key-alias" "androiddebugkey" "--key-pass" "pass:android" failed (status: 1): Error: Program type already present: $r8$java8methods$utility$Integer$hashCode$II
[BT:0.9.0] Error: Dex merging failed.
com.android.tools.build.bundletool.model.exceptions.CommandExecutionException: Dex merging failed.
at com.android.tools.build.bundletool.mergers.D8DexMerger.translateD8Exception(D8DexMerger.java:98)
at com.android.tools.build.bundletool.mergers.D8DexMerger.merge(D8DexMerger.java:77)
at com.android.tools.build.bundletool.mergers.ModuleSplitsToShardMerger.mergeDexFiles(ModuleSplitsToShardMerger.java:333)
at com.android.tools.build.bundletool.mergers.ModuleSplitsToShardMerger.lambda$mergeDexFilesAndCache$3(ModuleSplitsToShardMerger.java:300)
at java.util.HashMap.computeIfAbsent(HashMap.java:1127)
at com.android.tools.build.bundletool.mergers.ModuleSplitsToShardMerger.mergeDexFilesAndCache(ModuleSplitsToShardMerger.java:298)
at com.android.tools.build.bundletool.mergers.ModuleSplitsToShardMerger.mergeSingleShard(ModuleSplitsToShardMerger.java:192)
at com.android.tools.build.bundletool.mergers.ModuleSplitsToShardMerger.merge(ModuleSplitsToShardMerger.java:106)
at com.android.tools.build.bundletool.splitters.BundleSharder.shardBundle(BundleSharder.java:102)
at com.android.tools.build.bundletool.splitters.ShardedApksGenerator.generateSplits(ShardedApksGenerator.java:68)
at com.android.tools.build.bundletool.commands.BuildApksManager.execute(BuildApksManager.java:200)
at com.android.tools.build.bundletool.commands.BuildApksCommand.execute(BuildApksCommand.java:486)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:74)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:46)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:76)
at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45)
at com.android.tools.r8.D8.run(D8.java:67)
at com.android.tools.build.bundletool.mergers.D8DexMerger.merge(D8DexMerger.java:70)
... 12 more
Caused by: com.android.tools.r8.utils.AbortException
at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:77)
at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:58)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:67)
... 15 more
As I searched, I find out that the error could be caused by using the old bundle tool version 0.9.0 (fixed in version 0.10.3). For more information please refer to this link.
Are there any ways that I can change the bundle tool version to 0.10.3 or do anythings to prevent this from happening?
Thanks and hope to hear from you guys soon.