在从旧的AdView迁移时,在布局AdMob中创建新的XML遇到了非常奇怪的问题。
好的。产品目标- Google 19默认属性- Google 8
google lib在项目中被引用,似乎被解压缩,然后被包含到结果apk中(证据如下)。
我的布局中有以下代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.android.gms.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0"
android:orientation="vertical" >
...
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
ads:adSize="BANNER"
ads:adUnitId="@string/admob_unit_id"
/>当我加载布局时,我得到了异常。
我看到了以下可疑的事情:
因此,我假设google play库本身没有任何问题。然而,当我调试这个异常时--我有一个内部异常-- NoClassDefFoundException,所以看起来我错过了google lib
我说错了
- error: No resource identifier found for attribute 'adSize' in package MYPACKAGE所以我不得不加上
xmlns:ads="http://schemas.android.com/apk/lib/com.google.android.gms.ads"在布局声明的顶部,以消除
有什么想法吗?我在这里读过一些相关的主题,它们似乎都与谷歌播放库缺位有关,但情况似乎并非如此。
发布于 2014-09-06 18:36:24
改变:
xmlns:ads="http://schemas.android.com/apk/lib/com.google.android.gms.ads"至:
xmlns:ads="http://schemas.android.com/apk/res-auto"https://stackoverflow.com/questions/25701889
复制相似问题