问题
I am trying to use Android App Bundle but getting an error of
"File 'root/AndroidManifest.xml' uses reserved file or directory name 'AndroidManifest.xml'."
I have two .aar and one .jar file in my libs folder, and tried getting a bundle by both Build>Build bundles and "./gradlew bundle", but still got the error.
This is actually a rewrite of a project, and the old project which uses the same dependencies creates a bundle without a problem.
The error happens in gradle task "packageProductionDebugBundle", I've also looked at bundletool source code but could not figure out the reason of the problem.
The error is probably happening in BundleFilesValidator in bundletool, as you can see from the line.112 of the class below.
https://github.com/google/bundletool/blob/master/src/main/java/com/android/tools/build/bundletool/validation/BundleFilesValidator.java
I have two product flavors, but removing them did not change a thing.Also tried to delete many of the dependencies and their dependent classes but that also did not help.
I'd appreciate any suggestion to look where this problem's cause lies.
Also is there any way to debug "packageProductionDebugBundle" task of the bundletool in Gradle, I might have a better idea about the problem if I can.
回答1:
Finally, after trying everything, I've decided to remove all dependencies, and adding them one by one, I found that one of the libraries I am using -"youappi" library in this instance- was causing this problem.After deleting it, the problem is solved.
来源:https://stackoverflow.com/questions/52675036/android-bundle-build-error-fileusesreservednameexception