当我尝试添加admob时,添加的依赖项是
implementation 'com.google.android.gms:play-services-ads:17.1.1'
https://imgur.com/XodA9vJ
错误详细信息:
所有com.android.support库必须使用完全相同的版本>规范(混合版本可能导致运行时崩溃)。找到的版本> 28.0.0,26.1.0。示例包括com.android.support:animated-vector->drawable:28.0.0和com.android.support:support-media-compat:26.1.0 less ...>(Ctrl + F1) 检查信息:库,工具或库的某些组合不兼容或可能导致错误。一种这样的不兼容性是使用不是最新版本的Android支持库版本进行编译(或者特别是低于您的targetSdkVersion的版本)。问题ID:GradleCompatible
试图更改较低的appcombat版本
//code
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "highproteinfoodsofalltimes.com.highproteinfoods"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '28.0.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
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'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.google.android.gms:play-services-ads:17.1.1'
}
答案 0 :(得分:1)
将这3行添加到您的依赖项build.gradle
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'