由于AndroidManifest.xml存在问题,因此无法构建APK [英] Cannot build an APK due to problems with AndroidManifest.xml

查看:157
本文介绍了由于AndroidManifest.xml存在问题,因此无法构建APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,每当我加载项目时,我都会立即收到以下错误:

For some reason, whenever I load my project, I immediately get the following error:

我的AndroidManifest.xml中的代码:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.avi12.palindrome"
    android:versionCode="59"
    android:versionName="3.3" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="27" />

    <application
        android:allowBackup="true"
        android:debuggable="true"
        android:fullBackupContent=""
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.avi12.palindrome.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!--
             ATTENTION: This was auto-generated to add Google Play services to your project for
             App Indexing.  See https://g.co/AppIndexing/AndroidStudio for more information.
        -->
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name="com.google.android.gms.common.api.GoogleApiActivity"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <provider
            android:name="com.google.firebase.provider.FirebaseInitProvider"
            android:authorities="com.avi12.palindrome.firebaseinitprovider"
            android:exported="false"
            android:initOrder="100" />

        <meta-data
            android:name="android.arch.lifecycle.VERSION"
            android:value="27.0.0-SNAPSHOT" />
    </application>

</manifest>

我尝试清理项目,但没有帮助,
我不确定导致这些错误的原因. 结果,我无法构建APK.
我该如何解决?谢谢!

I tried cleaning the project, but it didn't help,
I'm unsure what's causing these errors.
As a result, I cannot build an APK.
How do I solve this? Thanks!

推荐答案

android:fullBackupContent=""不能为空,因此应指向XML,其中应包含定义备份策略的规则

android:fullBackupContent="" cannot be empty so it should point to XML which should contains the rules to define the backup policy

来自文档AndroidManifest.xml中,将android:fullBackupContent属性添加到<application>元素.此属性指向包含备份规则的XML文件.例如:

From Docs In AndroidManifest.xml, add the android:fullBackupContent attribute to the <application> element. This attribute points to an XML file that contains backup rules. For example:

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

res/xml/目录中创建一个名为my_backup_rules.xml的XML文件.在文件内部,添加带有<include><exclude>元素的规则.以下示例备份除device.xml之外的所有共享首选项:

Create an XML file called my_backup_rules.xml in the res/xml/ directory. Inside the file, add rules with the <include> and <exclude> elements. The following sample backs up all shared preferences except device.xml:

<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
    <include domain="sharedpref" path="."/>
    <exclude domain="sharedpref" path="device.xml"/>
</full-backup-content>


从错误日志中,您还可以将boolean值定义为

or
From error logs you can also define boolean value as

// hasn't test it but
// judging from error android:fullBackupContent (attr)reference|boolean
android:fullBackupContent=false 

这篇关于由于AndroidManifest.xml存在问题,因此无法构建APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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