安装FCM插件后,构建failes

时间:2017-10-10 10:59:56

标签: cordova cordova-plugins google-play-services cordova-plugin-fcm

我正在尝试在Ionic3中通过FCM实现推送通知。我已按照Ionic FCM docs中的所有内容进行操作。一切顺利但当我试图建立然后我得到下面的错误。如何解决这个问题,提前谢谢。

    BUILD FAILED
    Total time: 2.138 secs
    Error: cmd: Command failed with exit code 1 Error output:
    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':processDebugGoogleServices'.
    > Please fix the version conflict either by updating the version of the google-services plugin (information
    about the latest version is available at
    https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of
    com.google.android.gms to 9.0.0.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

1 个答案:

答案 0 :(得分:0)

试试这个:转到plugins文件夹并打开fcm插件的文件夹。然后,您导航至src/android并打开FCMPlugin.gradle并更改以下行:

classpath 'com.google.gms:google-services:3.0.0'

到这个

classpath 'com.google.gms:google-services:3.1.1'

保存文件,然后删除Android平台(cordova platform rm android)并再次添加(cordova platform add android)。