![](/img/trans.png)
[英]Getting error:The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[11.0.4,11.0.4]]
[英]The library com.google.android.gms:play-services-basement is being requested
通知依賴項解析偵聽器失敗。
各種其他庫都在[[11.0.2,11.0.2],[15.0.1,15.0.1]]請求庫com.google.android.gms:play-services-basement庫,但解析為15.0。 1。 禁用插件,並使用./gradlew:app:dependencies檢查您的依賴關系樹。
構建應用程序時出現此錯誤,這是我的收獲
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.example.radon.vitrin"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
implementation 'com.google.zxing:core:3.2.1'
implementation files('libs/CircleImageViewmaster/gradle/wrapper/gradle-wrapper.jar')
implementation files('libs/picasso-2.5.2(1).jar')
implementation 'com.android.support:multidex:1.0.1'
//noinspection GradleCompatible
implementation 'com.android.support:design:26.0.0-alpha1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.0.0-alpha1'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services:11.0.2'
//noinspection GradleCompatible
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation ('io.socket:socket.io-client:1.0.0') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
implementation 'com.google.firebase:firebase-core:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
嘗試將Firebase依賴關系從16.0.1降級到16.0.0。 如果這不起作用,請嘗試升級Google Play服務依賴項
implementation 'com.google.android.gms:play-services:16.0.0'
以使其正常工作。
確保將您的Google Play服務依賴性和Firebase依賴性保持在最新版本
在此處查看Google Play服務更新版本
在此處查看Firebase更新版本
在此處查看適用於Android的Firebase更新版本
添加以下Gradle依賴項以消除GMS版本中的歧義:
implementation 'com.google.android.gms:play-services-vision:17.0.2'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.