离子 - cordova插件gradle冲突

时间:2017-08-08 15:27:34

标签: android cordova ionic-framework android-gradle

这是离子v1。

嗨,我正在使用Firebase插件发送通知https://github.com/fechanique/cordova-plugin-fcm,并且需要在应用处于后台时跟踪地理位置,因此我也使用(或尝试)此插件:https://github.com/transistorsoft/cordova-background-geolocation-lt/

尝试构建时出现问题。

ionic cordova build android

    Found com.google.android.gms:play-services-location:+, but version 9.0.0 is needed for the google-services
    plugin.
    Found com.google.firebase:firebase-core:+, but version 9.0.0 is needed for the google-services plugin.
    Found com.google.firebase:firebase-messaging:+, but version 9.0.0 is needed for the google-services plugin.
    :processDebugGoogleServices FAILED

    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.

    BUILD FAILED

    Total time: 1.56 secs
    Error: /Users/id/Documents/a/b/c/project/platforms/android/gradlew: 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.

我试图通过切换数字来解决这个问题,阅读有关gradle配置的文档,但我似乎无法找到解决方案。 (我认为切换版本是解决方案..)

这些是插件的.gradle文件。

科尔多瓦-背景地理位置-lt.gradle

repositories{    
  jcenter()
  flatDir{
      dirs 'src/android/libs'
   }
}

dependencies {
    compile 'com.google.android.gms:play-services-location:+'
    compile 'com.android.volley:volley:1.0.0'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile(name:'tslocationmanager', ext:'aar')
    // logback-android
    compile 'org.slf4j:slf4j-api:1.7.21'
    compile 'com.github.tony19:logback-android-core:1.1.1-6'
    compile('com.github.tony19:logback-android-classic:1.1.1-6') {
        exclude group: 'com.google.android', module: 'android'
    }
}

科尔多瓦-插件-fcm.gradle

buildscript {
    repositories {
            jcenter()
            mavenLocal()
        }
    dependencies {
        classpath 'com.android.tools.build:gradle:+'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

顺便说一下,我正在使用来自cordova的平台android@6.2.3。如果您还需要或想知道其他任何内容,请询问。

提前感谢您的时间!

0 个答案:

没有答案