【问题标题】:AAPT: error: '' is incompatible with attribute allowBackup (attr) booleanAAPT:错误:“”与属性 allowBackup (attr) boolean 不兼容
【发布时间】:2021-04-08 19:30:08
【问题描述】:

这是我的代码 出现以下错误我该如何解决? (AAPT:错误:'' 与属性 allowBackup (attr) boolean 不兼容。) 我有消息说(“构建”文件夹下的文件已生成,不应编辑)

<?xml version="1.0" encoding="utf-8"?> <manifest
xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.brokersystem"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="30" />

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup=""
        android:appComponentFactory="androidx.core.app.CoreComponentFactory"
        android:debuggable="true"
        android:fullBackupContent="@xml/backup_descriptor"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:testOnly="true"
        android:theme="@style/Theme.BrokerSystem" >
        <activity android:name="com.example.brokersystem.completTrans" />
        <activity
            android:name="com.example.brokersystem.terms1"
            android:label="@string/title_activity_terms1"
            android:theme="@style/Theme.BrokerSystem.NoActionBar" />
        <activity android:name="com.example.brokersystem.forgPass" />
        <activity android:name="com.example.brokersystem.singUp" />
        <activity android:name="com.example.brokersystem.welcom" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

【问题讨论】:

    标签: android android-activity


    【解决方案1】:

    我遇到了同样的问题,它对我有用

    尝试删除: android:fullBackupContent="" in AndroidManifest.xml 并让

    android:allowBackup="true" 收到警告。

    【讨论】:

      【解决方案2】:

      allowBackup 属性内部应该有一个布尔值,truefalse。将其设置为您喜欢的值,错误应该会消失。

      android:allowBackup="true"
      
      android:allowBackup="false"
      

      来源:allowBackup 文档。

      【讨论】:

      • 我试过了,但没用(“build”文件夹下的文件已生成,不应编辑)此消息出现在栏工具上的代码上方
      • 这是另一个可能对您有所帮助的问题。 Files under the build folder...
      • 我现在发生了什么-我的android studio突然停止并显示(android studio和插件更新可用:组件:android模拟器)
      • 我什么都做不了,我尝试卸载程序并重新安装它,但出现同样的问题
      • 更新您的 src manifest.xml 文件不应破坏应用程序,如果是这种情况,我怀疑您更改了一些您不应该更改的内容,例如构建文件夹中的文件,如消息所示那些生成的,不应该改变。仅更改 src 文件夹中的文件。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-28
      • 2020-08-31
      • 2018-06-20
      • 1970-01-01
      • 2018-06-13
      • 1970-01-01
      相关资源
      最近更新 更多