FCMPlugin build fail due to version conflict with google gms services

后端 未结 5 1376
无人及你
无人及你 2021-01-03 06:45

I\'m using this with ionic 2 on Windows for Android. When I add cordova-plugin-fcm plugin, I cannot build the project anymore. Here is the error that I\'m getting:



        
5条回答
  •  心在旅途
    2021-01-03 07:16

    I solved it.

    plugings:

    https://github.com/mauron85/cordova-plugin-background-geolocation

    https://github.com/fechanique/cordova-plugin-fcm

    1). remove platform: cordova platform rm android.

    2). modify: plugins/cordova-plugin-fcm/src/android/FCMPlugin.gradle

    replace:

    apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
    

    with:

    ext.postBuildExtras = {
        apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
    }
    

    3) add platform: cordova platform add android.

    4) modify: platforms/android/project.properties

    change the "+" for "11.4.2":

    com.google.firebase:firebase-core:+
    com.google.firebase:firebase-messaging:+
    com.google.android.gms:play-services-location:+
    

    should look like this:

    com.google.firebase:firebase-core:11.4.2
    com.google.firebase:firebase-messaging:11.4.2
    com.google.android.gms:play-services-location:11.4.2
    

    that's all :).

提交回复
热议问题