Ionic:app:processDebugGoogleServices(版本冲突)

时间:2018-06-10 19:07:41

标签: ionic-framework

我在离子应用上安装了push插件,但是这个构建失败了

Found firebase-messaging:11.6.2, but version 11.0.4 is needed for the google-services plugin.
:app:processDebugGoogleServices FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app: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 11.0.4.

我的build.gradle(模块:app)

dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    implementation(project(path: ":CordovaLib"))
    compile "com.facebook.android:facebook-android-sdk:4.+"
    compile "com.google.android.gms:play-services-base:11.0.4"
    compile "com.google.android.gms:play-services-ads:11.0.4"
    compile "com.android.support:support-v13:23+"
    compile "com.android.support:support-v13:27.+"
    compile "me.leolin:ShortcutBadger:1.1.17@aar"
    compile "com.google.firebase:firebase-messaging:11.6.2"
    // SUB-PROJECT DEPENDENCIES END
}

1 个答案:

答案 0 :(得分:0)

config.xml中声明FCM版本,如下所示:

<plugin name="phonegap-plugin-push" spec="^2.1.3">
    <variable name="FCM_VERSION" value="11.6.2" />
</plugin>

如果这不起作用,我用来解决讨厌的离子构建问题的一些步骤是:

  • rm -rf node_modules
  • ionic cordova platform rm
  • rm -rf platforms
  • rm -rf plugins
  • npm install
  • ionic cordova platform add