Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android App Bundle build fails

I have problem with building our app with new Google's feature which name is App Bundle.

When I run ./gradlew app:packageProductionReleaseBundle --stacktrace command, I receive:

Execution failed for task ':app:packageProductionReleaseBundle'.
            java.util.concurrent.ExecutionException: com.android.tools.build.bundletool.exceptions.ValidationException: Error validating module 'base'.
                              ...
                           LONG STACK TRACE...
                              ...
Caused by: com.android.tools.build.bundletool.exceptions.BundleFileTypesException$FileUsesReservedNameException: File 'root/res/drawable/adoceansdk_close_interstitial_button.png' uses reserved file or directory name 'res'.
                at com.android.tools.build.bundletool.validation.BundleFilesValidator.validateModuleFile(BundleFilesValidator.java:112)
                at com.android.tools.build.bundletool.validation.ValidatorRunner.lambda$validateBundleModules$6(ValidatorRunner.java:73)
                at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:406)
                at com.android.tools.build.bundletool.validation.ValidatorRunner.validateBundleModules(ValidatorRunner.java:73)

The reason for this is the external library in .jar we use.

How can I fix it without removing this library?

Thank you for the answer in advance.

like image 711
jczerski Avatar asked May 10 '18 18:05

jczerski


1 Answers

If this external library is meant to be used in an Android app, I believe it should be exported as an AAR, not a JAR. See https://developer.android.com/studio/projects/android-library

like image 56
Pierre Avatar answered Sep 22 '22 00:09

Pierre