So, I followed the Google Maps API v2 for Android, trying to get the main map on the screen. After completing all the steps, I get a fragment of the class "Destruction of errors." Other people have faced the same problem, but none of the solutions seem to work. Exact error: android.view.InflateException: Binary XML file line #10: Error inflating class fragment
.java
import android.os.Bundle; import android.view.Menu; import android.support.v4.app.FragmentActivity; public class GoogleMaps extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_google_maps); } @Override public boolean onCreateOptionsMenu(Menu menu) {
XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".GoogleMaps" > <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment" android:name="com.testing.svma.MainActivity"/> </RelativeLayout>
I think I’ve set up Google Play services correctly, and will ask them to download when the page is transferred for the first time. Here are my project.properties:
# Project target. target=android-17 android.library=false android.library.reference.1=../../../android-sdks/extras/google/google_play_services/libproject/google-play-services_lib
log cat:
... 03-06 21:12:44.751: I/System.out(9122): Debugger has connected 03-06 21:12:44.751: I/System.out(9122): waiting for debugger to settle... 03-06 21:12:46.166: I/System.out(9122): debugger has settled (1487) 03-06 21:12:50.634: D/dalvikvm(9122): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp 03-06 21:12:50.634: W/dalvikvm(9122): VFY: unable to resolve instance field 23 03-06 21:12:50.634: D/dalvikvm(9122): VFY: replacing opcode 0x52 at 0x0012 03-06 21:12:50.634: D/dalvikvm(9122): VFY: dead code 0x0014-0018 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b (Landroid/content/res/Resources;)Z 03-06 21:12:51.126: W/dalvikvm(9122): Unable to resolve superclass of Lmaps/p/s; (427) 03-06 21:12:51.126: W/dalvikvm(9122): Link of class 'Lmaps/p/s;' failed 03-06 21:12:51.126: W/dalvikvm(9122): Unable to resolve superclass of Lmaps/y/bo; (3820) 03-06 21:12:51.126: W/dalvikvm(9122): Link of class 'Lmaps/y/bo;' failed 03-06 21:12:51.126: W/dalvikvm(9122): Unable to resolve superclass of Lmaps/i/k; (4208) 03-06 21:12:51.126: W/dalvikvm(9122): Link of class 'Lmaps/i/k;' failed 03-06 21:12:51.126: E/dalvikvm(9122): Could not find class 'maps.i.k', referenced from method maps.z.ag.a 03-06 21:12:51.126: W/dalvikvm(9122): VFY: unable to resolve new-instance 3540 (Lmaps/i/k;) in Lmaps/z/ag; 03-06 21:12:51.126: D/dalvikvm(9122): VFY: replacing opcode 0x22 at 0x006d 03-06 21:12:51.149: D/dalvikvm(9122): VFY: dead code 0x006f-007f in Lmaps/z/ag;.a (Landroid/view/LayoutInflater;Lcom/google/android/gms/maps/GoogleMapOptions;ZLjava/lang/String;)Lmaps/z/ag;
I tried solutions from these threads with no luck:
Error inflating a class fragment
Google Maps V2 - Error inflating a fragment of a class
I also just followed this guide and got the same error:
https://www.youtube.com/watch?v=OZRgiwGfvSQ
source share