2016-10-10 170 views
0

所示。这是我的项目生成级代码AdMob广告不能在真实设备

// 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' 

}

测试广告在showimg了仿真器,但没有广告在真正的device.please帮我

我跟随以下链接,以获得广告 https://firebase.google.com/docs/admob/android/quick-start

我也跟着下面的链接设置火力 https://firebase.google.com/docs/android/setup

+0

亲切分享日志乳清你在实际设备上运行它。 –

+0

我无法看到我的设备,当我点击运行method.I手动安装apk文件到设备 –

回答

0

你在项目中的广告暴民创建特定类别的使用广告单元ID。

因为您已经在您的项目中创建了横幅广告单元 - 您将在列表中看到横幅广告单元ID,使用该广告单元ID(您会在创建横幅广告时看到广告单元ID低于您的标题)。

欲了解更多信息,请参阅https://support.google.com/admob/answer/3052638你会得到我想解释的。

相关问题