0

I'm trying to set up an app with two different sync adapters but the package installer isn't satisfied with my provider declaration. It says

Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/com.daykm.tiger-1: Can't install because provider name com.daykm.tiger.mentions (in package com.daykm.tiger) is already used by com.daykm.tiger]

but I'm not seeing the conflict in provider name.

Here's the services and provider in the manifest:

    <service
        android:name=".sync.TimelineSyncService"
        android:enabled="true"
        android:exported="true"
        android:process=":sync">
        <intent-filter>
            <action android:name="android.content.SyncAdapter" />
        </intent-filter>
        <meta-data
            android:name="android.content.SyncAdapter"
            android:resource="@xml/timelinesync" />
    </service>

    <service
        android:name=".sync.MentionsSyncService"
        android:enabled="true"
        android:exported="true"
        android:process=":sync">
        <intent-filter>
            <action android:name="android.content.SyncAdapter" />
        </intent-filter>
        <meta-data
            android:name="android.content.SyncAdapter"
            android:resource="@xml/mentionsync" />
    </service>

    <provider
        android:name="com.daykm.tiger.sync.TwitterContentProvider"
        android:authorities="com.daykm.tiger.timeline;com.daykm.tiger.mentions"
        android:exported="false"
        android:syncable="true" />

mentionsync.xml:

<?xml version="1.0" encoding="utf-8"?>
<sync-adapter
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:contentAuthority="@string/authority_mentions"
    android:accountType="@string/account_type"
    android:userVisible="false"
    android:supportsUploading="false"
    android:allowParallelSyncs="false"
    android:isAlwaysSyncable="false"/>

timelinesync.xml:

<?xml version="1.0" encoding="utf-8"?>
<sync-adapter
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:contentAuthority="@string/authority_timeline"
    android:accountType="@string/account_type"
    android:userVisible="false"
    android:supportsUploading="false"
    android:allowParallelSyncs="false"
    android:isAlwaysSyncable="false"/>

account_sync.xml holding strings for all the syncing stuff:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="account_type">tiger.com</string>
    <string name="authority_timeline">com.daykm.tiger.timeline</string>
    <string name="authority_mentions">com.daykm.tiger.mentions</string>
    <string name="intent_name">database-change</string>
</resources>
Daykm
  • 475
  • 1
  • 5
  • 13

2 Answers2

1

Change the value of allowParallelSyncs from False to True. You can also check out this link Android multiple sync adapter items like Google Account?

Community
  • 1
  • 1
0

I think you can't create 2 sync adapters with the same accountType, try using two different values for the two sync adapters.

marmor
  • 27,641
  • 11
  • 107
  • 150
  • I figured that having multiple syncing servies is how you have multiple listings in the system menus, System > accounts > accountType. Is that not how it works? – Daykm Aug 24 '16 at 18:09