Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13145

Create playservices version preference in config.xml

    XMLWordPrintableJSON

    Details

      Description

      We are seeing an issue in the community of two plugins using different versions of google play services. This causes gradle to error out. We are running into this with the phonegap-push-plugin.

      Potential solution:

      We could create an Android only preference called PlayServicesVersion in config.xml which would control the version of Play Services used for the entire project.

      In config.xml:

      <preference name="PlayServicesVersion" value="11.0.1"/>
      

      Then if the push plugin wanted to include the FCM libraries in it's plugin.xml it would do:

      <framework src="com.google.firebase:firebase-messaging:$PlayServicesVersion"/>
      and the cordova-plugin-google-analytics wanted to include Play Services in it's plugin.xml it would do:

      <framework src="com.google.android.gms:play-services-analytics:$PlayServicesVersion" />
      

      they would both use the same version of Play Services. This gets around the problem of plugins using + in the framework tag and having two plugins pin different versions of Play Services.

      The + wildcard fails to compile with the following error:

      > Failed to apply plugin [id 'com.google.gms.google-services']
         > For input string: "+"
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              stevegill Steve Gill
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: