Android Bundle构建错误:FileUsesReservedNameException [英] Android Bundle Build Error : FileUsesReservedNameException

查看:1017
本文介绍了Android Bundle构建错误:FileUsesReservedNameException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Android App Bundle,但出现

I am trying to use Android App Bundle but getting an error of

文件'root/AndroidManifest.xml'使用保留的文件或目录名称 "AndroidManifest.xml".

"File 'root/AndroidManifest.xml' uses reserved file or directory name 'AndroidManifest.xml'."

我的libs文件夹中有两个.aar和一个.jar文件,并尝试通过Build> Build捆绑包和"./gradlew捆绑包"来获取捆绑包,但仍然出现错误.

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.

该错误发生在gradle任务"packageProductionDebugBundle"中,我也查看了bundletool源代码,但无法找出问题的原因.

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.

该错误可能是在bundletool的BundleFilesValidator中发生的,正如您从下面的类的line.112中可以看到的.

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.

也可以在Gradle中调试bundletool的"packageProductionDebugBundle"任务,如果可以的话,我可能对这个问题有更好的了解.

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.

推荐答案

最后,在尝试了所有方法之后,我决定删除所有依赖项,并将它们一个接一个地添加,我发现我正在使用的一个库-在这种情况下,"youappi"库导致了此问题.删除它后,问题就解决了.

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.

这篇关于Android Bundle构建错误:FileUsesReservedNameException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆