我遵循此link将广告集成到我的应用程序中。但是它显示了这个错误:
这是我的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'
}
}
广告没有显示在真实的device.please帮助我这是我在更新类路径error 后的错误
发布于 2017-11-08 11:14:45
在项目级别build.gradle添加classpath com.google.gms:google-services:3.0.0
依赖项
参考项目级build.gradle中的样例块
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
发布于 2019-03-17 00:36:33
只需在android/build.gradle中添加"classpath 'com.google.gms:google-services:3.0.0'“,如下所示
buildscript {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
在android/app/build.gradle的文件末尾添加"apply plugin:'com.google.gms.google-services'“,如下所示
apply plugin: 'com.google.gms.google-services'
发布于 2019-11-08 17:40:56
转到Setting > Android SDK > SDK Tools > Google Play Services
https://stackoverflow.com/questions/39892622
复制相似问题