我会集成GDPR SDK,但总是会收到此错误,我该怎么做才能解决此错误
无法解决: com.google.android.ads.consent:consent-library:1.1.0
build.gradle(模块)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.artdevstudio.currencyconverter"
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.google.android.ads.consent:consent-library:1.1.0'
compile 'com.google.android.gms:play-services-ads:15.0.1'
compile 'com.android.support:design:27.1.1'
compile 'agency.tango.android:material-intro-screen:0.0.3'
compile 'com.github.GrenderG:Prefs:1.1'
}
build.gradle(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
maven {
url "http://repo1.maven.org/maven2"
}
google()
}
}
答案 0 :(得分:1)
consent SDK的最新版本是1.0.6,而不是1.1.0。尝试改用此方法:
implementation 'com.google.android.ads.consent:consent-library:1.0.6'
答案 1 :(得分:0)
在相关性部分下,将compile
替换为implementation
。