2017-03-02 62 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>