Fixed
Status Update
Comments
ku...@google.com <ku...@google.com>
je...@google.com <je...@google.com> #2
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.
<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.
de...@google.com <de...@google.com> #4
@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.
pl...@gmail.com <pl...@gmail.com> #5
I've added
android {
defaultConfig.applicationId = "my.package.id "
}
to my gradle file and it fixed that issue for me
android {
defaultConfig.applicationId = "
}
to my gradle file and it fixed that issue for me
g....@gmail.com <g....@gmail.com> #6
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.
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.
Description
We have a Gradle plugin that does some bytecode instrumentation.
We still use the deprecated Transform API until we finished the transition to the new ASM API.
However, we have noticed that with AGP 7.2 our bytecode transformation does not work properly anymore when there is also a plugin applied that uses the ASM API.
It appears that something happened between AGP 7.2.0-alpha02 and AGP 7.2.0-alpha03 that changed the way the output of our transform task is linked to the input of the dexBuilder.
As a consequence, our transformed classes are not used.
Please take a look at the attached txt file that shows that the output directory of the transform task is not properly linked on 7.2.
STEPS TO REPRODUCE:
1. open the attached sample project
2. the sample project registers one transformer that uses the old transform API and one that uses the ASM API
3. build the project and take a look at the log output
4. the log output depicts how task outputs and inputs are linked
5. try with AGP version 7.1.3 and 7.2.0 and you will get the result shown in the attached txt file
------------------
Studio Build:
Version of Gradle Plugin: 7.2.0
Version of Gradle: 7.3.3
Version of Java: 11
OS: Win