android - 使用 Admob 强制关闭

标签 android admob

我刚刚用 sdk-r17 更新了我的 android,用 ADT-17 更新了 eclipse。现在,我所有使用 admob 的应用程序在真实设备或模拟器上构建和运行后都会导致强制关闭(更新前运行良好)

这是我的 xml 布局:

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<com.google.ads.AdView 
    android:id="@+id/admob"
    android:layout_alignParentBottom="true" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    ads:adUnitId="xxxxxx"
    ads:adSize="BANNER"
    ads:loadAdOnCreate="true"/>

<ListView
    android:id="@+id/lv_agent"
    android:layout_above="@id/admob"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:cacheColorHint="#00000000"
    android:focusable="true" 
    android:layoutAnimation="@anim/l_slide_right"
    android:listSelector="@drawable/bg_list_selector"
    android:divider="#3f3f3f"

logcat 错误信息是:

AndroidRuntime(29533): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{net.londatiga.xxx/net.londatiga.xxx.xxx}: android.view.InflateException: Binary XML file line #19: Error inflating class com.google.ads.AdView

有什么解决办法吗?

最佳答案

这个问题是Android项目中的依赖jar。解决方案好像看到了http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17

关于android - 使用 Admob 强制关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9826663/

相关文章:

serialization - Kotlin 数据类使用 GSON 动态创建其字段的 json

java - 如何在 Android 4.0+ 中同时禁用 EditText View 中的软件键盘并使光标可见?

java - 广告未加载

android - Admob 有很多请求但没有展示次数

android - 在 ionic android 平台中放置插页式广告的正确方法

android - Admob 与 android 非市场

android - Firebase AdMob 警告 : 'the ad request was successful but no ad was returned due to lack of ad inventory'

android - 如何使用 gradle kotlin dsl 设置单元测试 jvmargs

android - AIR for Android 检查互联网连接问题 (actionscript 3)

android - 如何在 OnTounchEvent 中旋转、缩放和平移 Canvas 上的位图