未找到 ID 为“com.google.gms.google-services”的插件

2024-01-31

我已经关注了这个link https://firebase.google.com/docs/admob/android/quick-start将广告集成到我的应用程序中。但它显示了这个错误:

这是我的 build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"





defaultConfig {
    applicationId "com.example.personal.numbermania"
    minSdkVersion 10
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
buildTypes {
    debug
            {
                debuggable true
            }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.google.firebase:firebase-ads:9.6.0'

}

}

广告未在真实设备中显示。请帮助我 这是我更新类路径后的错误error https://i.stack.imgur.com/XY6JO.png


有同样的问题。

通过添加依赖项修复

classpath 'com.google.gms:google-services:3.0.0'

to the root build.gradle.

https://firebase.google.com/docs/android/setup#manually_add_firebase https://firebase.google.com/docs/android/setup#manually_add_firebase

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

未找到 ID 为“com.google.gms.google-services”的插件 的相关文章

随机推荐