Android Bundle Build Error : FileUsesReservedNameException

限于喜欢 提交于 2019-12-11 15:43:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!