I spent 24 hours trying to deploy simple Android apps for Android v2. I searched in many forums (including stackoverflow) ... but I'm desperate. Error:
android.view.InflateException: Binary XML file line #7: Error inflating class fragment
Here is the activity_main.xml file
<?xml version="1.0" encoding="utf-8" ?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment" />
MainActivity.java
package com.gotme.gotmemaps; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.Menu; 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) {
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gotme.gotmemaps" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" /> <permission android:name="com.gotme.gotmemaps.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <uses-permission android:name="com.gotme.gotmemaps.permission.MAPS_RECEIVE"/> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <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" > <activity android:name="com.gotme.gotmemaps.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> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyDHfwlSoRWb6xDrpowyMWWap9Du5LQCVRM"/> </application> </manifest>
I installed the * google_play_services_lib * library, but always get the same error ... Can someone help me?
Thanks a lot!
UPDATE:
Here is my logcat:
11-19 12:25:23.745: E/AndroidRuntime(7163): FATAL EXCEPTION: main 11-19 12:25:23.745: E/AndroidRuntime(7163): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gotme.gotmemaps/com.gotme.gotmemaps.MainActivity}: android.view.InflateException: Binary XML file line
source share