0

Please can someone help, I have followed every tutorial I have found on displaying the Google Maps API on an android program/device and cannot get it to work.

On my latest try I'm getting a runtime error "Unable to start activity ComponentInfo"

11-06 11:46:36.832: E/AndroidRuntime(24596): FATAL EXCEPTION: main
11-06 11:46:36.832: E/AndroidRuntime(24596): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.maptest/com.example.maptest.MainActivity}: android.view.InflateException: Binary XML file line #17: Error inflating class fragment
11-06 11:46:36.832: E/AndroidRuntime(24596):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
11-06 11:46:36.832: E/AndroidRuntime(24596):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)

main.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=".MainActivity" >

<TextView
    android:id="@+id/header"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/hello_world" />

<fragment
    android:id="@+id/map"
    android:name="com.google.android.gms.maps.MapFragment"
    android:layout_below="@+id/header"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    />

Thank you in advanced for any help.

user2960322
  • 31
  • 1
  • 3

2 Answers2

0
Binary XML file line #17: Error inflating class fragment

Perhaps you should use

class="com.google.android.gms.maps.MapFragment"

in place of

android:name="com.google.android.gms.maps.MapFragment"
Tech Agent
  • 657
  • 5
  • 12
  • Thanks for the suggestion, just replaced that line and i get exactly the same error message on logCat "Error inflating class fragment" – user2960322 Nov 06 '13 at 13:21
0

I faced the same and get it solved by adding below lines in manifest file.

<meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
Toral
  • 551
  • 1
  • 5
  • 13