[ 
https://issues.apache.org/jira/browse/CB-10014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15014843#comment-15014843
 ] 

Josh Kasten commented on CB-10014:
----------------------------------

I created a workaround by reading the AndroidManifest.xml file.


h5. For App Developers

Create the following file under _<project-root>/platforms/android_
{code:language=cppl|title=build-extras.gradle|borderStyle=solid}
def manifest = new XmlSlurper().parse(file("AndroidManifest.xml"))
android.defaultConfig.applicationId manife...@package.text()
{code}

\\

h5. For Plugin Developers
{code:language=xml|title=plugin.xml|borderStyle=solid}
<framework src="build-extras-PLUGIN_NAME_HERE.gradle" custom="true" 
type="gradleReference" />
{code}

{code:language=cppl|title=build-extras-PLUGIN_NAME_HERE.gradle|borderStyle=solid}
def manifest = new XmlSlurper().parse(file("AndroidManifest.xml"))
android.defaultConfig.applicationId manife...@package.text()
{code}

\\
Cordova team, let me know if there is a better work around.

> Gradle variable applicationId is not set, creates issue with Google Play 
> services 8.3.0
> ---------------------------------------------------------------------------------------
>
>                 Key: CB-10014
>                 URL: https://issues.apache.org/jira/browse/CB-10014
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 5.4.1
>            Reporter: Josh Kasten
>              Labels: android, gradle
>
> applicationId is not set in build.gradle which creates an issue with 
> com.google.android.gms:play-services-measurement:8.3.0. This aar file has the 
> following line in AndroidManifest.xml
> {code:xml}
> <provider
>    android:authorities="${applicationId}.google_measurement_service"
>    
> android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
>    android:exported="false"/>
> {code}
> applicationId becomes `com.google.android.gms.measurement` when the manifest 
> entry is merged since applicationId is not set in the main project .gradle 
> file. This means that if another app also includes the Google Play services 
> library 8.3.0 it will fail to install on the device with an 
> INSTALL_FAILED_CONFLICTING_PROVIDER error because the name isn't unique.
> This is silent problem to developers as it only becomes an issue when the end 
> user installs 2 apps built this way. This should be addressed quickly to 
> prevent this error when developers release their APK or provide a work around 
> for plugin developers to add something to their plugin.xml to default in the 
> applicationId gradle variable.
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to