[英]error: cannot find symbol class DaggerAppComponent version conflict with other dependencies
[英]Version conflict error without adding any dependencies that the error showing?
根據圖像,我沒有添加與錯誤顯示相關的任何依賴關系,即使在添加了沖突錯誤中顯示的依賴關系后,也再次給了我與下面相同的錯誤。
請通過更新google-services插件的版本來解決版本沖突(有關最新版本的信息, 請訪問https://bintray.com/android/android-tools/com.google.gms.google-services/ )或將com.google.android.gms的版本更新為11.4.2。
這是我的build.gradle文件依賴項(添加了在圖像實現'com.android.support:customtabs:27.1.1'中顯示的依賴項之后)。
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.firebase:firebase-database:15.0.1'
implementation 'com.google.firebase:firebase-analytics:15.0.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation 'com.google.android.gms:play-services-maps:15.0.1'
//fb sdk
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
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'
這個問題不同於All com.android.support庫必須使用與應用程序正在構建和運行的完全相同的版本規范 。 但是在我的問題中,由於上述錯誤,應用程序構建失敗。 並且與添加的依賴項沒有任何版本沖突。
由於所有播放服務版本相同。
在gradle底部添加 apply plugin: 'com.google.gms.google-services'
。 這很可能會解決您的問題。
我的猜測是,您確實要聲明的庫又依賴於您還聲明的某些其他庫的其他版本,從而導致版本沖突。
命令gradle依賴關系可能是個好朋友。 運行該命令,可以查看樹中是否具有不同的庫依賴版本。
祝好運!
打開build.gradle並將targetSdkVersion
和complieSdkVersion
更改為27
defaultConfig {
applicationId "com.xxx.xxxxx"
minSdkVersion 15
targetSdkVersion 27
versionCode 59
versionName "7.5"
compileSdkVersion 27
buildToolsVersion "27.0.2"
multiDexEnabled true
}
請記住,您應該具有版本27的支持庫才能使其正常工作
將此添加到您的依賴項中
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.