【问题标题】:Having Error in Android Manifest while building构建时 Android Manifest 出现错误
【发布时间】:2021-02-26 02:23:41
【问题描述】:

任务“:app:processDebugResources”执行失败。

执行 com.android.build.gradle.internal.tasks.Workers$ActionFacade 时发生故障 Android资源链接失败 C:\Users\kcs\AndroidStudioProjects\OURVEDIC\app\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:11:AAPT:错误:找不到资源 xml/backup_descriptor(又名 com.binni.ourvedic:xml/backup_descriptor)。

这是我遇到的错误

我的代码:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.binni.ourvedic">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.OURVEDIC"
        android:fullBackupContent="@xml/backup_descriptor">
        <activity android:name=".SplashScreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".MainActivity">

        </activity>

        <meta-data
            android:name="preloaded_fonts"
            android:resource="@array/preloaded_fonts" />
    </application>

</manifest>

【问题讨论】:

  • 所以你有一个文件values/xml/backup_descriptor.xml
  • 不,我从 Github 克隆了这个文件

标签: java android android-manifest


【解决方案1】:

删除manifest文件中应用程序标签中的android:fullBackupContent="@xml/backup_descriptor"行,或将所需的xml文件添加到您的项目中。

<application
    android:fullBackupContent="@xml/backup_descriptor">
    ...
</application>

【讨论】:

  • 我删除了这一行:android:fullBackupContent="@xml/backup_descriptor" 并且成功了,谢谢。
【解决方案2】:

看起来如果你克隆了使用共享首选项的项目,这个错误不会通过简单的删除而消失

 android:fullBackupContent="@xml/backup_descriptor

为了解决这个问题,在res文件夹中新建一个xml类型的资源目录。 在此文件夹中创建一个名为:“backup_descriptor”的文件 并将此标签复制到其中:

<full-backup-content>
</full-backup-content>

【讨论】:

    【解决方案3】:

    在 Android Studio 中,试试这个

    File > Invalidate Caches/Restart
    

    【讨论】:

      【解决方案4】:

      只删除

      <meta-data
       android:name="preloaded_fonts"
       android:resource="@array/preloaded_fonts" />
      

      【讨论】:

        猜你喜欢
        • 2015-11-16
        • 1970-01-01
        • 1970-01-01
        • 2016-08-10
        • 2018-09-28
        • 1970-01-01
        • 1970-01-01
        • 2014-12-29
        • 2023-03-14
        相关资源
        最近更新 更多