Google Play Services GCM 9.2.0 asks to “update” back to 9.0.0

前端 未结 11 1517
眼角桃花
眼角桃花 2020-12-07 11:35

So this morning I started updating to the latest version of my project libraries.

I\'m trying to update GCM to the latest version 9.2.0, but I get this error:

<
相关标签:
11条回答
  • 2020-12-07 12:13

    For Cordova OR Ionic Hybrid App

    I have the very similar problem with my Ionic 1 Cordova Build after Integrating the Firebase Cloud Messaging ( FCM )

    I fixed this issue by the following steps

    So one fix will be: inside platforms/android open project.properties (Its a file ) , you will have something like this

    cordova.system.library.1=com.google.android.gms:play-services-ads:+
    cordova.system.library.2=com.google.firebase:firebase-core:+
    cordova.system.library.3=com.google.firebase:firebase-messaging:+
    

    Replace the

    +

    Sign with your target version number - like the following

    cordova.system.library.1=com.google.android.gms:play-services-ads:9.0.0
    cordova.system.library.2=com.google.firebase:firebase-core:9.0.0
    cordova.system.library.3=com.google.firebase:firebase-messaging:9.0.0
    

    Save the file

    Then take build using

     ionic cordova run android
    

    I hope this will work for everyone

    0 讨论(0)
  • 2020-12-07 12:15

    Add this line at the bottom of the gradle.

    apply plugin: 'com.google.gms.google-services'

    because it the top it does not work.I was facing similar problem.

    0 讨论(0)
  • 2020-12-07 12:16

    Your target SDK might be higher than SDK of the device, change that. For example, your device is running API 23 but your target SDK is 25. Change 25 to 23.

    0 讨论(0)
  • 2020-12-07 12:18

    if you have Firebase included also, make them of same version as the error says.

    0 讨论(0)
  • 2020-12-07 12:21

    The same situation was with the previous versions. It's annoing that new versions com.google.android.gms libraries are always releasing before plugin, and it's impossible to use new version because is incompatible with old plugin. I don't know if plugin is now required (google docs sucks). I remember times when it wasn't. The only way is wait for new plugin version, or you can try to remove plugin dependencies, but as I said I'am not sure if gcm will work without it. What I know the main feature of 9.2.0 version is new Awareness API https://inthecheesefactory.com/blog/google-awareness-api-in-action/en, if you didn't need it, you can use 9.0.0 version without any trouble.

    0 讨论(0)
  • 2020-12-07 12:22

    open app/build.gradle from your app-module and rewrite below line after dependencies block. This allows the plugin to determine what version of Play services you are using

    apply plugin: 'com.google.gms.google-services'
    

    I got this idea from here. In this tutorial second point is saying that above plugin line be at the bottom of your app/build.gradle file so that no dependency collisions are introduced. Hope it will help you out.

    0 讨论(0)
提交回复
热议问题