无法建立同意书库:1.0.7

时间:2019-02-04 23:06:10

标签: android gradle sdk

添加[@ https://developers.google.com/admob/android/eu-consent]]后,我无法构建项目 我遇到了以下错误!

  

无法解决':app @ debug / compileClasspath'的依赖关系:可以   无法解析com.google.android.ads.consent:consent-library:1.0.7。

buildscript {

repositories {
    jcenter()
    google()
   // maven { url 'https://jitpack.io' }
}
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 {
    google()
    jcenter()
     maven {
         url "https://maven.google.com"
     }
    }
  }



   dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
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.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
 implementation 'com.google.android.gms:play-services-ads:17.1.1'
implementation 'com.google.android.ads.consent:consent-library:1.0.7'

}

1 个答案:

答案 0 :(得分:0)

只有1.0.6版本,如您提供的链接所述:

implementation "com.google.android.ads.consent:consent-library:1.0.6"

要使其正常工作,您还需要将此插件添加到buildscript依赖项中:

classpath "com.google.gms:google-services:4.2.0"

并在文件底部应用该插件:

apply plugin: "com.google.gms.google-services"

,并且需要将一个google-services.json文件添加到项目中,该文件提供了ga_trackingId ...参见documentation