-1

I am developping an app and i wanna display a google map v2 on activity but it doesn't show this is a snippet form logcat

11-30 19:14:56.681: E/AndroidRuntime(6062): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cultural/com.example.cultural.MainActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class fragment

11-30 19:14:56.681: E/AndroidRuntime(6062): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 6171000 but found 0. You must have the following declaration within the element:

Rami
  • 7,879
  • 12
  • 36
  • 66
Ufuk Garip
  • 43
  • 1
  • 7

2 Answers2

0

Make sure you have the following inside the <application> element in your AndroidManifest.xml.

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version"/>
Eugen Pechanec
  • 37,669
  • 7
  • 103
  • 124
  • I check it and i have new problem 12-01 14:03:27.942: E/AndroidRuntime(4430): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cultural/com.example.cultural.MainActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class fragment – Ufuk Garip Dec 01 '14 at 12:11
0

Make sure you add this to your manifest application tag :

<application
   ... >
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="YOUR KEY HERE" />
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

and see comment below or check this :

Android Google Maps API "Error inflating class fragment"

Community
  • 1
  • 1
A Honey Bustard
  • 3,433
  • 2
  • 22
  • 38
  • I check it and i have new problem 12-01 14:03:27.942: E/AndroidRuntime(4430): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cultural/com.example.cultural.MainActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class fragment – Ufuk Garip Dec 01 '14 at 12:15
  • Check your layout XML. `` starts with a small "f". If this didn't help, post the layout in the question. – Eugen Pechanec Dec 01 '14 at 13:03
  • here is my layout – Ufuk Garip Dec 03 '14 at 09:53
  • I tried your xml but it doesnt solve my problem I got this bugs 12-03 13:39:15.009: E/AndroidRuntime(3544): Caused by: android.view.InflateException: Binary XML file line #20: Class is not a View com.google.android.gms.maps.MapFragment 12-03 13:39:15.009: E/AndroidRuntime(3544): Caused by: java.lang.ClassCastException: com.google.android.gms.maps.MapFragment cannot be cast to android.view.View – Ufuk Garip Dec 03 '14 at 11:48
  • Sorry, never used a map v2 in a Fragment before. All I know its available API 12+ only. Maybe using a MapView instead of a Fragment is the solution : – A Honey Bustard Dec 03 '14 at 12:13