cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gearóid M (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CB-14154) Expose gradle configuration properties in config.xml to assist aligning Google Play Services / Firebase
Date Fri, 22 Jun 2018 03:41:00 GMT

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

Gearóid M commented on CB-14154:
--------------------------------

Ah I see! I'm not too familiar with using Google Play Services, but had remembered reading
that blog post. Perhaps you could create a PR to add these config properties? It sounds like
you have a very good idea of how it would work.

> Expose gradle configuration properties in config.xml to assist aligning Google Play Services
/ Firebase
> -------------------------------------------------------------------------------------------------------
>
>                 Key: CB-14154
>                 URL: https://issues.apache.org/jira/browse/CB-14154
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: cordova-android
>    Affects Versions: cordova-android-7.0.0
>            Reporter: Christopher Scott
>            Assignee: Joe Bowser
>            Priority: Major
>              Labels: build
>
> I am a full-time plugin developer.  Like many other plugins, I import Google Play Services
dependencies in addition to Android Support libraries (appcompat-v7).
> By far the biggest problem I encounter with my users is [Gradle conflicts|https://github.com/transistorsoft/cordova-background-geolocation-lt/issues?utf8=%E2%9C%93&q=android+build+error]
due to multiple plugins importing different versions of {color:#333333}play-services / Firebase
/ com.android.support{color} libraries.
> Many plugin authors do the wrong thing and simply use version ":+", eg: [cordova-plugin-firebase|https://github.com/arnesson/cordova-plugin-firebase/blob/master/plugin.xml#L61-L67]].
> Quite often, my solution for these users is to [edit platforms/android/project.properties|https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/699#issuecomment-396083457]*_,_* which
is not the best long-term solution, since this file is _volatile_.
> What I've been doing since cordova@7.1.0 is [expose custom config properties in my plugins'
plugin.xml|https://github.com/transistorsoft/cordova-background-geolocation-lt/blob/master/plugin.xml#L98-L101]. 
This is nice, but users must align their google-play / Firebase / Support dependencies [for
each plugin that exposes these|https://github.com/transistorsoft/cordova-background-geolocation-lt#configuring-play-services-version]
helpful properties (and not many plugins do).
>  
> What would *_really_* help, is if cordova-android could expose variables in the app's
config.xml in the same manner as:
>  * cdvCompileSdkVersion
>  * cdvBuildToolsVersion
>  * cdvMinSdkVersion
> I would like to see the following properties added:
>  * cdvGooglePlayServicesVersion
>  * cdvSupportLibVersion
> (Note:  cdvGooglePlayServicesVersion could be named cdvGoogleApiVersion as a more common
name, since both Firebase and Google Play Services dependencies must be aligned to the same
version.)
> I would like to be able to access these properties in my plugin's [plugin.xml here|https://github.com/transistorsoft/cordova-background-geolocation-lt/blob/master/plugin.xml#L99]]
instead of using my plugin's custom $GOOGLE_API_VERSION variable.
> In a React Native app, which provides direct control over one's top-level build.gradle,
we do it [like this|https://github.com/transistorsoft/rn-background-geolocation-demo/blob/master/android/build.gradle#L33-L38]]. 
3rd-party plugins then check for the existence of these Gradle Config Properties when importing
their Google dependencies, [like this|https://github.com/transistorsoft/react-native-background-geolocation/blob/master/android/build.gradle#L33].
> This technique is also recommend at android.developer.com in the document [Gradle Tips
and Tricks|https://developer.android.com/studio/build/gradle-tips] (search "project-wide properties")
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message