Reputation: 265
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.
Upvotes: 8
Views: 4578
Reputation: 17397
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
Upvotes: 3
Reputation: 94
One of the solution can be you get pre- compiled library file of this google module. I think a little google. search will help you. I myself would have done that but i didn't get the name of the module you are asking.
So, try and search for lib.so file this way you will get the functionality provided by the module as well now there will be no need to compile it.
One more advantage is that compiling the module from scratch results in much much bigger apk size while using precompiled libraries result in much lesser apk size.
Upvotes: -2