【问题标题】:admob ads are not shown in real deviceadmob 广告未在真实设备中显示
【发布时间】:2016-10-10 13:59:10
【问题描述】:

这是我的项目构建等级代码

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
        classpath 'com.google.gms:google-services:1.3.0-beta1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这是我的应用构建等级代码

apply plugin: 'com.android.application'

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'
    compile 'com.google.firebase:firebase-core:9.6.1'

}
apply plugin: 'com.google.gms.google-services'

}

在模拟器中显示测试广告,但在真实设备中没有广告。请帮助我

我点击以下链接获取广告 https://firebase.google.com/docs/admob/android/quick-start

我按照下面的链接设置 Firebase https://firebase.google.com/docs/android/setup

【问题讨论】:

  • 请分享您在实际设备上运行的日志。
  • 当我点击运行方法时我看不到我的设备。我正在手动将 apk 文件安装到设备中

标签: android firebase admob


【解决方案1】:

在 ad mob 中使用您在项目中创建的特定类别的广告单元 ID。

例如,您在项目中创建了横幅广告单元 - 您将在列表中看到使用该广告单元 ID 的横幅广告单元 ID(您将在创建横幅广告时给出的标题下方看到广告单元 ID)。

有关更多信息,请参阅https://support.google.com/admob/answer/3052638,您将得到我想要解释的内容。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-13
    • 1970-01-01
    • 2013-12-27
    • 1970-01-01
    相关资源
    最近更新 更多