这是我的admob的xml代码 在添加广告之前,每件事情都可以正常工作,但现在它会崩溃应用程序,强行关闭。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/libs/com.google.ads"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/sidney">
<com.google.ads.AdView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="here is my ID"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" >
</com.google.ads.AdView>
</LinearLayout>
这是我的build.gradle代码
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 17
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile files ('libs/jsoup-1.7.3.jar')
compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar')
}
我还将GoogleAdMobAdsSdk-6.4.1.jar放在我项目的libs文件夹中。
这是我的Mainfest.xml,其中包含活动AdActivity
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
它显示渲染问题无法实例化以下类。在视图部分,当我在模拟器或我的Android手机上运行它崩溃,显示强制关闭...请提前帮助thanx
答案 0 :(得分:0)
这只是警告,当我运行应用程序时,其负载非常精确并准确显示admob广告,