简体   繁体   English

我在 Android 中创建 App Bundle 时出错:使用保留文件或目录名称“res”

[英]I am getting error in creating App Bundle in Android: uses reserved file or directory name 'res'

I am trying to create app bundle in native Android application and getting following error我正在尝试在本机 Android 应用程序中创建应用程序包并收到以下错误

Execution failed for task ':app:packageDEVreleaseBundle'.任务 ':app:packageDEVreleaseBundle' 执行失败。

A failure occurred while executing com.android.build.gradle.internal.tasks.PackageBundleTask$BundleToolWorkAction File 'root/res/drawable-anydpi-v24/<>.xml' uses reserved file or directory name 'res'.执行 com.android.build.gradle.internal.tasks.PackageBundleTask$BundleToolWorkAction 文件“root/res/drawable-anydpi-v24/<>.xml”使用保留文件或目录名称“res”时发生故障。

Earlier issue was occuring for AndroidManifest.xml file, I have used AndroidManifest.xml 文件出现了较早的问题,我使用过

packagingOptions {
        //pickFirst '**/*.so'
        doNotStrip "*/armeabi/*.so"
        doNotStrip "*/armeabi-v7a/*.so"
        doNotStrip "*/arm64-v8a/*.so"
        doNotStrip "*/x86/*.so"
        doNotStrip "*/x86_64/*.so"
        doNotStrip "*/mips/*.so"
        doNotStrip "*/mips64/*.so"
        exclude 'AndroidManifest.xml'
    }

If I exclude anydpi folder then it starts giving error in hdpi folder and keep on, in the end it also starts giving error in layout files which shows that problem area is something else.如果我排除任何 dpi 文件夹,那么它开始在 hdpi 文件夹中给出错误并继续,最后它也开始在布局文件中给出错误,这表明问题区域是别的东西。

Problem was in one of custom Android library project which we had created.问题出在我们创建的一个自定义 Android 库项目中。 Android was showing incorrect error. Android 显示不正确的错误。 In Android library project, we had added one another custom android library as aar file.在 Android 库项目中,我们添加了另一个自定义 android 库作为 aar 文件。 Same custom library was added in all other library project and application project as Maven dependency.在所有其他库项目和应用程序项目中添加了相同的自定义库作为 Maven 依赖项。 After removing aar file and using maven dependency, problem got fixed.删除 aar 文件并使用 maven 依赖项后,问题得到解决。

暂无
暂无

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

相关问题 无法使用 android 的 App Bundle 构建 Unity 应用程序。 文件使用保留文件或目录名称“res” - Can't build Unity app using App Bundle for android. File uses reserved file or directory name 'res' 尝试构建android应用程序捆绑包时出现“使用保留文件或目录名称&#39;lib&#39;”错误 - “Uses reserved file or directory name 'lib'” error when trying to build android app bundle 使用保留的文件或目录名称“ res” - uses reserved file or directory name 'res' Android错误:“文件&#39;root / res / drawable-mdpi / popup_bottom_medium.9.png&#39;使用保留的文件或目录名称&#39;res&#39;。” - Android Error: “File 'root/res/drawable-mdpi/popup_bottom_medium.9.png' uses reserved file or directory name 'res'.” 构建捆绑包:构建捆绑包文件时出错–&gt;文件&#39;root / res / drawable / sr_list_item_background.xml&#39;使用保留文件或目录名称&#39;res&#39; - Build Bundle(s): Errors while building Bundle file-->File 'root/res/drawable/sr_list_item_background.xml' uses reserved file or directory name 'res' 构建Android Bundle的问题-引发错误“文件&#39;root / lib / commons-io-2.4.jar&#39;使用保留的文件或目录名称&#39;lib&#39;” - Issue with building Android Bundle - throws error “File 'root/lib/commons-io-2.4.jar' uses reserved file or directory name 'lib'” Android App Bundle 构建错误:保留文件 - Android App Bundle build error: reserved file Android Studio3.2 APK 构建错误 -&gt; 保留文件或目录名称“lib” - Android Studio3.2 APK Build Error -> reserved file or directory name 'lib' 文件“root/AndroidManifest.xml”使用保留文件或目录名称“AndroidManifest.xml” - File 'root/AndroidManifest.xml' uses reserved file or directory name 'AndroidManifest.xml' 文件 'root/lib/META-INF/MANIFEST.MF' 使用保留文件或目录名称 'lib' - File 'root/lib/META-INF/MANIFEST.MF' uses reserved file or directory name 'lib'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM