Note that there are some explanatory texts on larger screens.

plurals
  1. POContentProvider won't show up in Data & Synchronization area
    text
    copied!<p>I'm trying to get a custom ContentProvider to show up under Data &amp; synchronization, and I'm running into some problems. Namely, it's not showing up.</p> <p>The specifics:</p> <p>My AndroidManifest.xml has the provider and service:</p> <pre><code>&lt;provider android:name="BooksProvider" android:label="ClientName Books" android:authorities="com.clientname.reader.books" android:enabled="true" android:exported="true" android:syncable="true"&gt; &lt;grant-uri-permission android:pathPattern=".*" /&gt; &lt;/provider&gt; &lt;service android:name=".sync.SyncService" android:exported="true" android:process=":sync"&gt; &lt;intent-filter&gt; &lt;action android:name="android.content.SyncAdapter" /&gt; &lt;/intent-filter&gt; &lt;meta-data android:name="android.content.SyncAdapater" android:resource="@xml/syncadapter" /&gt; &lt;/service&gt; </code></pre> <p>And res/xml/syncadapter.xml has the following:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;sync-adapter xmlns:android="http://schemas.android.com/apk/res/android" android:contentAuthority="com.clientname.reader.books" android:accountType="com.google" android:supportsUploading="true" android:userVisible="true" /&gt; </code></pre> <p>Just to be safe, I've even called the following on onCreate:</p> <pre><code>AccountManager accountManager = AccountManager.get(getApplicationContext()); Account[] accounts = accountManager.getAccountsByType("com.google"); for(Account account : accounts){ Log.d(TAG, "Account: " + account.name); ContentResolver.setIsSyncable(account, Reader.AUTHORITY, 1); } </code></pre> <p>When I load up the Activity, I get adb logging from ContentResolver.setIsSyncable saying that account is already set to be syncable, so the method isn't doing anything.</p> <p>And yet, the provider <strong>refuses</strong> to show up in Settings > Accounts &amp; Sync > Data &amp; synchronization. Any ideas on why? Anyone know how it's determined what appears in that section?</p> <p>[edit] Some more information:</p> <p>After spending hours debugging, I'm coming across this error:</p> <pre><code>04-11 10:46:02.370: DEBUG/SyncManager(105): can't find a sync adapter for SyncAdapterType Key {name=com.clientname.reader.books, type=com.google}, removing settings for it </code></pre> <p>It also appears my SyncService class is never actually getting called. Am I supposed to be invoking it myself? None of the samples I've seen or applications in the wild invoke it themselves, but they also all have auth components. Thoughts?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload