My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 784: Multiple apps using same authority provider name for AppMeasurementContentProvider
44 people starred this issue and may be notified of changes. Back to list
 
Reported by [email protected], Nov 6, 2015
Name of affected component: Core Reporting API

Google Play Services 8.3.0

Issue summary:
It seems that a new Provider has been added in 8.3.0 (AppMeasurementContentProvider) unfortunately the authorities field in the generated AndroidManifest.xml is not unique therefore apps can't be installed/updated due to INSTALL_FAILED_CONFLICTING_PROVIDER error.

Your AndroidManifest file (as seen in <project_folder>/build/intermediates/exploded-aar/com.google.android.gms/play-services-measurement/8.3.0/AndroidManifest.xml) contains the following provider definition:
<provider
          android:authorities="${applicationId}.google_measurement_service"
          android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
          android:exported="false"/>

When we build the project we get the following result in the merged <project_folder>/build/intermediates/manifests/full/prod/release/AndroidManifest.xml 
<provider
            android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
            android:authorities="com.google.android.gms.measurement.google_measurement_service"
            android:exported="false" />

As you can see the authorities is not unique to our app.
Nov 6, 2015
#1 [email protected]
As a workaround we added the following to our own manifest:
<provider
            tools:replace="android:authorities"
            android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
            android:authorities="${applicationId}.google_measurement_service"
            android:exported="false" />

You must have tools namespace defined in the xml.
Nov 11, 2015
#2 [email protected]
I've also been affected by this!
Nov 11, 2015
#3 [email protected]
@2 I also opened an issue with tools guys https://code.google.com/p/android/issues/detail?id=193567 . I'm not really sure which team should fix it. There's another workaround there that in my opinion is cleaner.
Nov 18, 2015
#4 [email protected]
I've added 
android {
    defaultConfig.applicationId = "my.package.id"
}

to my gradle file and it fixed that issue for me
Nov 24, 2015
#5 [email protected]
Setting android.defaultConfig.applicationId in your gradle file is something that is expected to be set in Android projects. This is automatically added when you create a new Android project in Android Studio.

However when applicationId isn't present in the project gradle the play-services-measurement AAR package in its AndroidManifest.xml gets defaulted in. This creates a silent issue for the app developer as their is no warnings or errors when the app builds. Only after another app that was build the same way is also installed on the device is the issue known as the OP noted with the INSTALL_FAILED_CONFLICTING_PROVIDER error.

The fix is adding android.defaultConfig.applicationId to your app's gradle file as others have noted however, the play-services-measurement AAR or the build tools should be changed to throw an error if this is missing.
Nov 24, 2015
#6 [email protected]
In cordova generated projects android.defaultConfig.applicationId is missing
Nov 24, 2015
#7 [email protected]
I have already opened an issue with Cordova on this not being adding by default and have provided a work around to set android.defaultConfig.applicationId in the comments until Cordova fixes this.
https://issues.apache.org/jira/browse/CB-10014
Nov 25, 2015
#8 [email protected]
Thanks for the solution in #4 - that worked for me!
Dec 3, 2015
#9 [email protected]
Are these apps successfully uploading to the play store? And users of the apps are seeing this error?

I'm wondering if the play store checks for authorities uniqueness to ensure this doesn't happen on a wide scale.
Dec 4, 2015
#10 [email protected]
#4 did the trick.
Dec 4, 2015
#11 [email protected]
The users only see an errormessage with code 505, an errormessage that is given for other installation-failures as well. 
Dec 12, 2015
#12 [email protected]
Error persists in Google Play Services version 8.4.89 (2428711-230).

Two apps I use are in conflict as described above in original post.

RadPad and Glassdoor.

Uninstall one, the other will install.

Any workaround for us users?
Dec 13, 2015
#13 [email protected]
#12, You can try using older version and send feedback to the developers and hope they will fix it fast
Dec 31, 2015
#14 [email protected]
#4 is the perfect solution, you saved my day!
Jan 18, 2016
#15 [email protected]
I'm desperately requesting your help.

I'm having some users complaining about Play Store Error 505.
I cannot apply solution #4 because my project is a library project, so I'm getting: "Error: Library projects cannot set applicationId."
My app is currently using Play Services 8.3.0. Does anyone know what else I can try? Thanks in advance!
Jan 18, 2016
#16 [email protected]
#15, who is using your library? he should set the app id.
Do you declare authority provider in your lib?
Jan 29, 2016
#17 [email protected]
I could reproduce and fix this issue. This is referred in the following thread: 
https://goo.gl/UvjIVk

Good luck & thank you.
Mar 12, 2016
#18 [email protected]
There's no gradle support in Intel-XDK yet, due to security issues. Is there another way around to solve this problem without gradle? 
Many thanks, 
Mar 14, 2016
Project Member #19 [email protected]
(No comment was entered for this change.)
Sign in to add a comment

Powered by Google Project Hosting