简体   繁体   English

Android Bundle 构建错误:FileUsesReservedNameException

[英]Android Bundle Build Error : FileUsesReservedNameException

I am trying to use Android App Bundle but getting an error of我正在尝试使用 Android App Bundle 但出现错误

"File 'root/AndroidManifest.xml' uses reserved file or directory name 'AndroidManifest.xml'." “文件‘root/AndroidManifest.xml’使用保留文件或目录名‘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.我的 libs 文件夹中有两个 .aar 和一个 .jar 文件,并尝试通过 Build>Build bundles 和“./gradlew bundle”获取一个包,但仍然出现错误。

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.该错误发生在 gradle 任务“packageProductionDebugBundle”中,我也查看了 bundletool 源代码,但无法找出问题的原因。

The error is probably happening in BundleFilesValidator in bundletool, as you can see from the line.112 of the class below.错误可能发生在 bundletool 中的 BundleFilesValidator 中,正如您从下面类的 line.112 中看到的那样。

https://github.com/google/bundletool/blob/master/src/main/java/com/android/tools/build/bundletool/validation/BundleFilesValidator.java 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.还有什么方法可以调试Gradle中bundletool的“packageProductionDebugBundle”任务,如果可以的话,我可能对这个问题有更好的了解。

最后,在尝试了一切之后,我决定删除所有依赖项,并一一添加它们,我发现我正在使用的库之一 - 在这种情况下是“youappi”库 - 导致了这个问题。删除后,问题已经解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM