[英]Error:(25, 13) Failed to resolve: com.google.android.gms:play-services-auth:9.8.0
[英]How to update com.google android.gms:play-services-auth:16.0.1?
我試圖在android-studio中運行代碼,但收到以下警告:“所有com.android.support庫都必須使用完全相同的版本規范(混合版本可能導致運行時崩潰)。找到的版本28.0.0,26.1.0 。示例包括com.android.support:animated-vector-drawable:28.0.0和com.android.support:support-v4:26.1。“如何解決此問題?
我知道問題出在這一行:實現'com.google.android.gms:play-services-auth:16.0.1'
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.irma"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
**implementation 'com.android.support:support-media-
compat:28.0.0'**
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-
layout:1.1.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'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
**implementation 'com.google.android.gms:play-services-auth:16.0.1'**
}
所以我在這里有沖突:實現'com.android.support:support-media-compat:28.0.0'和這里:實現'com.google.android.gms:play-services-auth:16.0.1'
但是play services-auth已經更新,但是程序仍在26.1.0版本上說。
設置-Google Play服務,如下所示,您可以看到最新的版本。 Google Play服務
您需要將Google登錄庫更新為最新版本。
就我而言,我需要將我的v7 AppCompat更新為v28。 之后,您提到的問題浮出水面。 將com.google.android.gms:play-services-auth:16.0.1
到最新版本會導致清單沖突,因為最新版本使用Androidx。 您可以將項目遷移到Androidx以支持play-services-auth
的最新版本,也可以排除依賴項。 我還不想遷移到Androidx,因此后者對我有效。 我在gradle文件中添加了以下內容:
implementation ('com.google.android.gms:play-services-auth:16.0.1'){
exclude group: 'com.android.support', module:'support-v4'
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.