広告付きのシンプルな線形レイアウトがあります。アプリケーションを起動すると、次のエラーが表示されます。
01-31 19:00:02.337: E/AndroidRuntime(11395): FATAL EXCEPTION: main
01-31 19:00:02.337: E/AndroidRuntime(11395): android.view.InflateException: Binary XML file line #34: Error inflating class com.google.ads.AdView
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
01-31 19:00:02.337: E/AndroidRuntime(11395): at com.devspark.sidenavigation.SideNavigationView$SideNavigationAdapter.getView(SideNavigationView.java:248)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.widget.AbsListView.obtainView(AbsListView.java:2159)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.widget.ListView.makeAndAddView(ListView.java:1831)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.widget.ListView.fillDown(ListView.java:674)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.widget.ListView.fillGap(ListView.java:638)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4930)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3087)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.widget.AbsListView.startScrollIfNeeded(AbsListView.java:3032)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.widget.AbsListView.onTouchEvent(AbsListView.java:3357)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.View.dispatchTouchEvent(View.java:7239)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2168)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1903)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
01-31 19:00:02.337: E/AndroidRuntime(11395): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1953)
01-31 19:00:02.337: E/AndroidRuntime(11395): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1405)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.app.Activity.dispatchTouchEvent(Activity.java:2410)
01-31 19:00:02.337: E/AndroidRuntime(11395): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1901)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.View.dispatchPointerEvent(View.java:7419)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3220)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3165)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4292)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4271)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4363)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:171)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4342)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4382)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.Choreographer.doFrame(Choreographer.java:530)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.os.Handler.handleCallback(Handler.java:725)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.os.Handler.dispatchMessage(Handler.java:92)
01-31 19:00:02.337: E/AndroidRuntime(11395): at android.os.Looper.loop(Looper.java:137)
01-31 19:00:02.337: E/AndroidRuntime(11395): at andr
どちらの場合も、最新の AdMob ライブラリが参照されています。jar はlibs
フォルダーにあり、Java ビルド パスに追加しました。
レイアウトコードは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.natinusala.pebkac"
xmlns:ads="schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="@dimen/side_navigation_item_padding_topbottom"
android:paddingLeft="0dp"
android:paddingRight="@dimen/side_navigation_item_padding_leftright"
android:paddingTop="@dimen/side_navigation_item_padding_topbottom"
>
<com.google.ads.AdView
android:id="@+id/advert"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:visibility="gone"
app:backgroundColor="#000000"
app:keywords="Android game"
app:textColor="#FFFFFF"
ads:addSize="BANNER" />
</LinearLayout>
私たちを手伝ってくれますか ?
ありがとう !