我正在尝试处理图像处理项目,我使用Firebase数据库,而当我试图根据相关性添加play-services-vision时,则会出现错误,即“库com.google.android.gms:play各种其他库正在[-[15.0.1,15.0.1]]请求-services-basement,但解析为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'
}
答案 0 :(得分:3)
要解决此问题,请更改以下代码行:
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'
到
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'
请确保在gradle文件的最后一行中包含以下代码行:
apply plugin: 'com.google.gms.google-services'
还请确保在您的顶级(项目)build.gradle
文件中包含以下Google服务插件:
classpath 'com.google.gms:google-services:4.2.0'