1

我試圖通過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. 

回答

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) 。

+1

我試過它大衛,但得到相同的錯誤。 – Niraj

+0

然後你的其他插件之一使用不同的google-services版本。你將不得不找出哪一個版本更改爲同一個版本。 – David