2017-03-02 58 views
0

我正在上运行我的应用程序下面的错误发现属性“域”没有资源标识符:在包“机器人”

MyApp的\程序\编译\ \中间体舱单\全\调试\ AndroidManifest.xml中 错误:(38)未找到包'android'中属性'domain'的资源标识符。

有人请帮忙。提前致谢。

这是我的AndroidManifest.xml:

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

    <!--xmlns:android="http://schemas.android.com/apk/res/android"--> 
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
    <uses-permission android:name="android.permission.INTERNET" /> 

    <application 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme" 
     android:allowBackup="true" 
     android:backupAgent="MyApp_BackupAgent"> 
     <meta-data android:name="com.google.android.backup.api_key" 
      android:value="API-KEY" /> 
     <!-- for backuping to google drive starts here--> 
     <full-backup-content> 
      <include 
       android:domain="database" 
       android:path="."> 
      </include> 
     </full-backup-content> 
     <!-- for backuping to google drive ends here--> 
     <activity android:name=".MyApp_MainActivity"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 
+0

首先,请勿在公共平台上公开您的API密钥。 –

+0

@ M.Ashish谢谢你的评论.. – AR5

+0

@Darpan ....感谢您的编辑。 – AR5

回答

0

你要做这样在本link

(I)中提到在AndroidManifest.xml,添加android:fullBackupContent属性的元素。该属性指向包含备份规则的XML文件。

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

(二)创建于res/xml/目录下名为my_backup_rules.xml的XML文件。在文件内部,使用<include><exclude>元素添加规则。以下示例备份除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>