“无法解决”;所有com.android.support库必须使用完全相同的版本规范;
我无法使用最新的targetSdkVersion 28和gradle:3.3.2编译我的项目,因为存在依赖冲突“所有com.android.support库必须使用完全相同的版本规范” 我在stackoverflow上读了很多关于这个问题的答案,但没有一个真正帮助我解决了这个问题。我在这里没有做任何花哨的事情,只是想包括所有最新的谷歌游戏、谷歌广告、firebase、facebook等的标准库。有人能告诉我正确的配置吗 目前,我有一个适用于targetSDKVersion 27的工作配置:“无法解决”;所有com.android.support库必须使用完全相同的版本规范;,android,dependencies,conflict,Android,Dependencies,Conflict,我无法使用最新的targetSdkVersion 28和gradle:3.3.2编译我的项目,因为存在依赖冲突“所有com.android.support库必须使用完全相同的版本规范” 我在stackoverflow上读了很多关于这个问题的答案,但没有一个真正帮助我解决了这个问题。我在这里没有做任何花哨的事情,只是想包括所有最新的谷歌游戏、谷歌广告、firebase、facebook等的标准库。有人能告诉我正确的配置吗 目前,我有一个适用于targetSDKVersion 27的工作配置: ap
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 369
versionName "4.0.2"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "tier"
productFlavors {
playStoreFree {
...
}
}
}
repositories {
mavenCentral()
maven {
url "https://maven.google.com"
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':SliderPreference')
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
implementation 'com.android.support:recyclerview-v7:27.0.2'
}
apply plugin: 'com.google.gms.google-services'
对我来说,始终需要添加以下内容:
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
看起来你也需要这个:
implementation 'com.android.support:customtabs:28.0.0'
您正在项目中使用一些库。其中一个必须使用不同版本(可能更低版本)的支持库。这些库的作者需要更新它们。但在此之前,您可以观看下面提到的视频以寻求解决方案。 本视频中使用的方法将对您有很大帮助
它似乎是这样工作的。太好了:)
你能显示你的完整的gradle文件吗?现在更好了还是你需要更多的文件?我需要删除常规行吗?实现'com.android.support:support-v4:28.0.0'不,您保留它。添加这些特定的依赖项只是告诉Gradle,如果版本号不匹配,则覆盖在其他库中找到的依赖项。
implementation 'com.android.support:customtabs:28.0.0'
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 369
versionName "4.0.2"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "tier"
productFlavors {
...
}
repositories {
mavenCentral()
maven {
url "https://maven.google.com"
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':SliderPreference')
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.android.gms:play-services-ads:17.1.3'
implementation 'com.google.android.gms:play-services-analytics:16.0.7'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
}
apply plugin: 'com.google.gms.google-services'