Look here 请尝试将ML Kit添加到我的应用的构建包中,但它无法完全运行。我猜它一定是来自我的build.gradle文件,但我不知道在哪里。请帮忙?

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'

    //Firebase libraries
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:17.1.0'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.firebase:firebase-ml-vision:16.0.0'

    //Other Stuff
    implementation 'com.firebase:geofire-android:2.3.0'
    implementation 'com.android.support:support-vector-drawable:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:support-v13:27.1.1'
    implementation 'com.r0adkll:slidableactivity:2.0.6'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.android.support:multidex:1.0.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:support-annotations:27.1.1'
    implementation 'com.google.android.gms:play-services:15.0.1'
}


下面是build.gradle(project)。我什至包括了Google存储库,但仍然无济于事。请帮忙

    buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0-alpha03'

        classpath 'com.google.gms:google-services:4.0.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven{
            url 'https://maven.google.com'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

最佳答案

Google API Release Notes表示对组合的play-services库的支持已于2018年4月结束:


  从15.0.0开始,将不再有播放服务别名
  目标是引入所有Google Play服务组件。这是
  建议反对一段时间。


您不能再指定对合并的Google Play服务目标implementation 'com.google.android.gms:play-services:15.0.1'的依赖性。如果以前的版本支持此功能,则它会引入所有Google Play库-远远超出您的需要。请参阅Setup Guide表1中的API列表,并仅包括您的应用使用的特定API。

Google Maven Repository的检查确认版本12.0.1是合并的play-services目标的最新版本。

10-08 03:14