库 com.google.android.gms:play-services-basement 被 [[15.0.1,15.0.1]] 的其他各种库请求,但解析为 16.1.0

Rut*_*art 4 java ocr android firebase google-play-services

我正在尝试处理图像处理项目,我使用 Firebase 数据库,当我尝试在依赖项中添加 play-services-vision 时,它出现了错误,即“库 com.google.android.gms:play-services- [[15.0.1,15.0.1]] 的其他各种图书馆正在请求地下室,但解析为 16.1.0。禁用插件并使用 ./gradlew :app:dependencies 检查你的依赖树。

dependencies {

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
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.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
}
Run Code Online (Sandbox Code Playgroud)

Ale*_*amo 5

要解决此问题,请更改以下代码行:

implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
Run Code Online (Sandbox Code Playgroud)

到

implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.android.gms:play-services-vision:16.2.0'
Run Code Online (Sandbox Code Playgroud)

请确保您将以下代码行作为 gradle 文件中的最后一行:

apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)

还请确保您的顶级(项目)build.gradle文件中有以下 Google 服务插件:

classpath 'com.google.gms:google-services:4.2.0'
Run Code Online (Sandbox Code Playgroud)