安装FCM插件后,构建失败

问题描述:

我试图通过FCM在Ionic3中推送通知。我已经按照Ionic FCM docs中的所有内容进行了操作。一切顺利,但当我试图建立,然后我得到了下面的错误。如何解决这个问题,提前致谢。安装FCM插件后,构建失败

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. 

试试这个:去你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) 。

+1

我试过它大卫,但得到相同的错误。 – Niraj

+0

然后你的其他插件之一使用不同的google-services版本。你将不得不找出哪一个版本更改为同一个版本。 – David