I’ve been at this for a very, very long time(3 weeks) in Eclipse. Using the ‘Getting Started’ guide for google maps android api v2 I keep running into this issue. I’ve tried all the various ways of making this work from posts on SO in addition to following various tutorials online & on youtube and I still can’t get it to function. I’ve used Activity, FragmentActivity, , , adding name to fragment and there’s still an error inflating the class fragment.
Main error(topmost error in LogCat)
03-12 11:50:04.793: E/AndroidRuntime(9002): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.map2/com.example.map2.MainActivity}: android.view.InflateException: Binary XML file line #13: Error inflating class fragment
MainActivty.java (I’ve tried both Activity & FragmentActivity)
package com.example.map2;
import android.os.Bundle;
//import android.app.Activity;
import android.view.Menu;
import android.support.v4.app.FragmentActivity;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
Activity_main.xml (I’ve used both MapFragment & SupportMapFragment)
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:name="com.example.map2.MainActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
Map2Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="19" />
<permission
android:name="com.example.map2.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.map2.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#" />
<activity
android:name="com.example.map2.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
screenshots of library settings, etc:



</application>closing tag at developers.google.com/maps/documentation/android/… . It has been a problem for other people before.