首页 > 解决方案 > 实施 'com.google.android.gms:play-services-ads:18.1.0'

问题描述

我想在我的项目中添加广告,但是当我添加下面的行时,它不起作用:

implementation 'com.google.android.gms:play-services-ads:18.1.0'

这些是来自的依赖项build.gradle

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.1'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'com.google.android.gms:play-services-ads:18.1.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

标签: javaandroidadmob

解决方案


尝试创建一个新项目并复制旧项目文件并粘贴到一个新项目中。如果它应该帮助!


推荐阅读