I have published an app which uses Google Maps Api V2. The app works fine
since the Api V2 with GooglePlayServices was introduced. Since some weeks
ago I received some stack traces withe the following error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{cnglpg.
finder/cnglpg.finder.lib.MapManager}: android.view.InflateException: Binary
XML file *line #15*: Binary XML file line #15: Error inflating class
fragment
at android.app.ActivityThread.performLaunchActivi
The error was reported only by users with a Xperia Z5 device, running
Android 6.0.
The app was tested on an emulator with Android 6.0 and on NVIDIA Shield
Tablet 6.0
Here the layout xml file:
<?xml version="1.0" encoding="utf-8"?>
<!-- -->
<android.support.v4.widget.DrawerLayout xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id="@+id/my_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!--
The first view of the DrawerLayout is the content view with the map
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!--Next line is line 15 -->
*<fragment*
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
*class="com.androidmapsextensions.SupportMapFragment" />*
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/btn_left"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:adjustViewBounds="true"
android:src="@drawable/ic_arrow_left_blue" />
<ImageButton
android:id="@+id/btn_right"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:adjustViewBounds="true"
android:src="@drawable/ic_arrow_right_blue" />
</RelativeLayout>
<ImageButton
android:id="@+id/btn_navi"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginRight="5dp"
android:adjustViewBounds="true"
android:src="@drawable/ic_arrow_turn_blue" />
</RelativeLayout>
<!--
android:layout_gravity="start" tells DrawerLayout to treat
this as a sliding drawer on the left side for left-to-right
languages and on the right side for right-to-left languages.
The drawer is given a fixed width in dp and extends the full
height of
the container. A solid background is used for contrast
with the content view.
-->
<LinearLayout
android:id="@+id/left_drawer"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="start" >
<fragment class="cnglpg.finder.lib.fragments.FragmentRoute"
android:id="@+id/id_fragment_route"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"/>
</LinearLayout>
<LinearLayout
android:id="@+id/right_drawer"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="end" >
<fragment class="cnglpg.finder.lib.fragments.FragmentStations"
android:id="@+id/fragment_stations"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="end"/>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
The fragment tag on line 15 (in bold) uses the class attribute. Should I
use the attribute android:name instead or both?
Has anyone experienced the same error? How to overcome it?
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/30df2491-2137-42c7-b629-7f608527b9c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.