【问题标题】:Failed to resolve: com.google.android.ads.consent:consent-library:1.1.0无法解决:com.google.android.ads.consent:consent-library:1.1.0
【发布时间】:2018-07-08 13:59:31
【问题描述】:

我想集成 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()
    }
}

【问题讨论】:

    标签: android android-gradle-plugin


    【解决方案1】:

    consent SDK 的最新版本是 1.0.6,而不是 1.1.0。尝试改用这个:

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

    【讨论】:

      【解决方案2】:

      将依赖项部分下的compile 替换为implementation

      【讨论】:

        猜你喜欢
        • 2021-12-07
        • 2019-05-11
        • 1970-01-01
        • 2018-07-17
        • 2020-01-17
        • 2018-09-25
        • 2018-02-08
        • 1970-01-01
        • 2020-01-31
        相关资源
        最近更新 更多