InflateException for admob's adview after using proguard

南笙酒味 提交于 2019-12-11 05:46:20

问题


I'm new to admob.I use Android froyo and I added Adview to my main.xml as follow:

<com.google.ads.AdView
        xmlns:googleads="http://schemas.android.com/apk/lib/com.google.ads"
        android:id="@+id/ad"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        googleads:adSize="BANNER"
        googleads:adUnitId="a14ed7ed1b71bc0" /> 

so when i try to deploy my app using adb everything is ok. But when i use proguard and i install the apk on my phone, app crashes at the begining.

Logcat says:

Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.google.ads.AdView

So I followed some posts here that says to rename lib app folder to libs but no result. I added

to my manifest app.But no result. Is admpob 4.3.1 compliant with froyo? I really have no idea what is the problem.Please help ciao


回答1:


In proguard manual, some examples are given. There it states

If you're using additional Google APIs, you'll have to specify those as well, for instance:

-libraryjars /usr/local/android-sdk/add-ons/google_apis-7_r01/libs/maps.jar

Try specifying the admob library path this way in proguard config file.

Link to Proguard Manual

Update

Have you added your jar to build path?
See if this helps



来源:https://stackoverflow.com/questions/10259405/inflateexception-for-admobs-adview-after-using-proguard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!