无法识别<sync-adapter>元素

时间:2017-10-17 10:01:47

标签: android xml android-resources android-syncadapter

当我尝试在我的应用程序中实现Sync Adapter Framework时,在运行应用程序之前会出现以下错误:

No resource identifier found for attribute 'contentAuhority' in package 'android'

我的syncadapter.xml资源文件

<?xml version="1.0" encoding="utf-8"?>
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
 android:accountType="example.com"
 android:allowParallelSyncs="false"
 android:contentAuhority="my.authority"
 android:isAlwaysSyncable="true"
 android:supportsUploading="false"
 android:userVisible="true" />

注意:<sync-adapter>元素未出现在建议中(在Android工作室中),但会出现<account-authenticator>

enter image description here

1 个答案:

答案 0 :(得分:0)

使用此

<?xml version="1.0" encoding="utf-8"?>
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
 android:accountType="example.com"
 android:allowParallelSyncs="false"
 android:contentAuthority="my.authority"
 android:isAlwaysSyncable="true"
 android:supportsUploading="false"
 android:userVisible="true" />