【发布时间】:2019-08-04 22:44:54
【问题描述】:
我想知道如何解决重复依赖的错误。 我没有库版本 9.6.1。它来自哪里?
这是我的build.gradle 文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.g_track"
minSdkVersion 20
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.gms:play-services-location:17.0.0'
//noinspection GradleCompatible
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.github.ar-android:DrawRouteMaps:1.0.0'
implementation 'com.github.jd-alexander:library:1.1.0'
implementation 'com.cs:googlemaproute:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'org.jetbrains:annotations-java5:15.0'
}
apply plugin: 'com.google.gms.google-services'
它给了我这个错误。我不要com.google.android.gms:play-services-places:9.6.1
在模块 classes.jar (com.google.android.gms:play-services-places-placereport:17.0.0) 和 classes.jar ( com.google.android.gms:play-services-places:9.6.1)
转到文档以了解如何修复依赖项解析错误。
【问题讨论】:
-
可能是因为使用了
'com.google.android.gms:play-services-location:17.0.0'和'com.google.android.gms:play-services-maps:16.1.0'。尝试 16 或 17 两者 -
@Psycho 我试过但同样的错误。