0

我的项目依赖项如下:

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
    classpath 'com.google.gms:google-services:4.0.1'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

修改原有依赖后,如下:

dependencies {
    implementation 'com.android.support:support-v4:27.0.1'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.0.1'
    implementation 'com.android.support:design:27.0.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.google.android.gms:play-services-wearable:15.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.firebaseui:firebase-ui:2.3.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    implementation 'com.gongwen:marqueelibrary:1.1.3'
    implementation 'devlight.io:navigationtabbar:1.2.5'
    implementation 'me.itangqi.waveloadingview:library:0.3.5'
    implementation 'com.yanzhenjie:recyclerview-swipe:1.1.4'
    implementation 'com.squareup.okhttp3:okhttp:3.2.0'
    implementation 'com.squareup.okio:okio:1.7.0'
    implementation 'com.google.firebase:firebase-ml-vision:16.0.0'
    implementation 'com.android.support:multidex:1.0.0'
}
apply plugin: 'com.android.application'

然后我添加了 firebase ML 依赖项,

com.google.firebase:firebase-ml-vision:16.0.0   

Gradle 构建失败,给我以下消息:

请通过更新 google-services 插件的版本来修复版本冲突(有关最新版本的信息可在https://bintray.com/android/android-tools/com.google.gms.google-services/获得)或将 com.google.android.gms 的版本更新为 11.4.2。

谁能帮我解决这个问题?

4

1 回答 1

2

更新以下内容:

compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'

对此:

implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'

还将google play services API更新到最新版本

在顶级 gradle 文件中:

改变:

classpath 'com.google.gms:google-services:3.1.0'

对此:

classpath 'com.google.gms:google-services:4.0.1'
于 2018-06-13T06:20:23.993 回答