kotmyrevich / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 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