paullangtree / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
2 stars 0 forks source link

Multiple apps using same authority provider name for AppMeasurementContentProvider #784

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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-se
rvices-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.

Original issue reported on code.google.com by ramon.sp...@gmail.com on 6 Nov 2015 at 12:25

GoogleCodeExporter commented 8 years ago
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.

Original comment by ramon.sp...@gmail.com on 6 Nov 2015 at 12:44

GoogleCodeExporter commented 8 years ago
I've also been affected by this!

Original comment by p...@samknows.com on 11 Nov 2015 at 1:53

GoogleCodeExporter commented 8 years ago
@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.

Original comment by ramon.sp...@gmail.com on 11 Nov 2015 at 3:38

GoogleCodeExporter commented 8 years ago
I've added 
android {
    defaultConfig.applicationId = "my.package.id"
}

to my gradle file and it fixed that issue for me

Original comment by m...@bnaya.net on 18 Nov 2015 at 12:36

GoogleCodeExporter commented 8 years ago
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.

Original comment by josh@onesignal.com on 24 Nov 2015 at 9:09

GoogleCodeExporter commented 8 years ago
In cordova generated projects android.defaultConfig.applicationId is missing

Original comment by m...@bnaya.net on 24 Nov 2015 at 9:20

GoogleCodeExporter commented 8 years ago
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

Original comment by josh@onesignal.com on 24 Nov 2015 at 9:24

GoogleCodeExporter commented 8 years ago
Thanks for the solution in #4 - that worked for me!

Original comment by p...@samknows.com on 25 Nov 2015 at 8:33

GoogleCodeExporter commented 8 years ago
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.

Original comment by lbarrett...@gmail.com on 3 Dec 2015 at 11:17

GoogleCodeExporter commented 8 years ago
#4 did the trick.

Original comment by nilsmag...@gmail.com on 4 Dec 2015 at 8:48

GoogleCodeExporter commented 8 years ago
The users only see an errormessage with code 505, an errormessage that is given 
for other installation-failures as well. 

Original comment by nilsmag...@gmail.com on 4 Dec 2015 at 10:45

GoogleCodeExporter commented 8 years ago
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?

Original comment by dr01dlab...@gmail.com on 13 Dec 2015 at 4:17

GoogleCodeExporter commented 8 years ago
#12, You can try using older version and send feedback to the developers and 
hope they will fix it fast

Original comment by m...@bnaya.net on 13 Dec 2015 at 8:13