【问题标题】:After installing FCM plugin, build failes安装 FCM 插件后,构建失败
【发布时间】:2017-10-10 10:59:55
【问题描述】:

我正在尝试在 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.

【问题讨论】:

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


    【解决方案1】:

    试试这个:转到您的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)。

    【讨论】:

    • 那么您的其他插件之一正在使用不同版本的 google-services。您将必须找出哪一个并将版本更改为相同的版本。
    猜你喜欢
    • 2021-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-08
    • 2023-03-29
    • 1970-01-01
    相关资源
    最近更新 更多