Wouldn't it be possible to have a more generic solution to handle gradle plugins in general, rather than Google Service specifically ?
Perhaps something similar to the <framework> tag in config.xml that is used to add libraries? I ran into a somewhat related issue with Firebase Crashlytics where the install instructions [1] ask you to add a gradle plugin at the top of the file, but using Cordova's build-extra only let you add it at the end. There doesn't seem to be a solution for this right now, unless I'm mistaken, so it would be nice if we could also handle this use case. 1: https://firebase.google.com/docs/crashlytics/get-started On 20 April 2018 at 15:49, Simon MacDonald <simon.macdon...@gmail.com> wrote: > No, I thought I'd start a discussion first. > > Simon Mac Donald > http://simonmacdonald.com > > On Fri, Apr 20, 2018 at 3:41 PM, Joe Bowser <bows...@gmail.com> wrote: > > > Is there a PR ready for this to land? > > > > On Fri, Apr 20, 2018 at 12:04 PM, Simon MacDonald < > > simon.macdon...@gmail.com > > > wrote: > > > > > Hey all, > > > > > > I'd like to suggest that we add a new Android preference. It would be a > > > boolean preference, to control whether or not to run the Google > Services > > > Plugin. > > > > > > A number of plugins need to have this gradle plugin run during build > time > > > and they are handling it via a gradle file included in their plugin > like > > > this: > > > > > > https://github.com/fechanique/cordova-plugin-fcm/blob/ > > > master/src/android/FCMPlugin.gradle > > > > > > but that falls down if two plugins try to apply GoogleServicesPlugin. > > > > > > The way to mitigate that right now is to have dependency on > > > cordova-support-google-services so it will only run once. > > > > > > <dependency id="cordova-support-google-services" version="~1.1.0"/> > > > > > > However, it makes sense for this to be a preference in cordova-android. > > > Perhaps, > > > > > > <preference name="android-RunGoogleServicesPlugin" value="true"/> > > > > > > If the value is true, then we apply the GoogleServicesPlugin. > > > > > > Simon Mac Donald > > > http://simonmacdonald.com > > > > > > -- Thomas Brian Développeur Frontend Frontend Developer tbr...@tobostudio.com <tbr...@tobogganstudio.com> www.tobostudio.com <http://tobostudio.com/>