'Unknown attribute android:fullBackupContent
I am trying to implement the backup functionality for my app, but I am running into the following problem:
- android studio tells me to set the
android:fullBackupContentattribute - when I set this it tells me that the attribute is not recognized
Here is how I have done above in the manifest xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.balla.popoint">
<application
android:allowBackup="true"
android:fullBackupContent="@res/xml/backup_rules.xml"
android:icon="@mipmap/app_icon"
android:label="@string/app_name"
android:theme="@style/PoPointTheme"
tools:ignore="GoogleAppIndexingWarning">
This is how the backup_rules.xml file looks like:
<full-backup-content>
<include domain="sharedpref" path="."/>
<include domain="root" path="./somefilename"/>
</full-backup-content>`
The warning that I get is this:
Unknown attribute android:fullBackupContent Inspection info: This inspection highlights unknown XML attributes in Android resource files and AndroidManifest.xml
Why is this warning displayed? What am I doing wrong?
Solution 1:[1]
Change android:fullBackupContent="@res/xml/backup_rules.xml" to android:fullBackupContent="@xml/backup_rules"
Also make sure the syntax of your file agrees with the following:
<full-backup-content>
<include domain=["file" | "database" | "sharedpref" | "external" | "root"]
path="string"
requiredFlags=["clientSideEncryption" | "deviceToDeviceTransfer"] />
<exclude domain=["file" | "database" | "sharedpref" | "external" | "root"]
path="string" />
</full-backup-content>
Solution 2:[2]
android:fullBackupContent="@xml/backup_descriptor
Delete this line from your manifest file
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nikos Hidalgo |
| Solution 2 | Anandh Krishnan |
