开发者

Error while reading content provider label

开发者 https://www.devze.com 2023-02-28 15:27 出处:网络
So, I trying to implement synchronization based on SyncAdapter of my content provider and server. Seems everything created and initializated well and I can see my account in Accounts&Sync and also

So, I trying to implement synchronization based on SyncAdapter of my content provider and server. Seems everything created and initializated well and I can see my account in Accounts&Sync and also see checkbox for syn开发者_Go百科c my content provider.

But I got strange error in LogCat:

ERROR/AccountSettings(130): Provider needs a label for authority 'com.opussync.model.db.opuscontentprovider'

But I has set that label in manifest for sure!

And that's why I think when I try to check sync checkbox in Data&Synchronization of my account I get a message:

Sync is currently experiencing problems. It will be back shortly

Here is main parts of my manifest:

    <!-- CONTENT PROVIDER -->

    <provider 
        android:name=".model.db.OpusContentProvider"
        android:label="BLABLABLA"
        android:authorities=".model.db.opuscontentprovider"
    ></provider>

    <!-- SERVICES -->

    <service android:name=".service.OpusAccountsSyncService" android:exported="true" android:process=":zencoosync">
        <intent-filter >
            <action android:name = "android.accounts.AccountAuthenticator"/>
        </intent-filter>
        <meta-data android:name="android.accounts.AccountAuthenticator"
            android:resource="@xml/authenticator" />
    </service>

     <service 
        android:name=".model.syncadapter.SyncService" 
        android:exported="true"
        android:syncable="true"
     >
        <intent-filter>
            <action android:name="android.content.SyncAdapter" />
        </intent-filter>
        <meta-data
            android:name="android.content.SyncAdapter"
            android:resource="@xml/syncadapter" />
    </service>


Package name is not automatically added to android:authorities.

So, either

  • change android:authorities=".model.db.opuscontentprovider" to android:authorities="com.opussync.model.db.opuscontentprovider" or
  • use content://.model.db.opuscontentprovider as the base URL for content provider in code.
0

精彩评论

暂无评论...
验证码 换一张
取 消