Skip to content Skip to sidebar Skip to footer

Android Google Map V2 Stopped

I'm trying to built map app and following this link step by step. I found similar topics in here but didn't help me. I want to show map, but when I run it, it return force close an

Solution 1:

Move this

 <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="0123456789abcde" />

 <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

to between your < application>< /application> tag.

Solution 2:

com.google.android.gms.R$styleable

This is usually due to having not referenced google play services properly

Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4242000 but found 0. You must have the following declaration within the element:

You are also missing 2 meta tags as a child of application tag of manifest file

<applicationandroid:allowBackup="true"android:icon="@drawable/ic_launcher"android:label="@string/app_name"android:theme="@style/AppTheme" ><meta-dataandroid:name="com.google.android.maps.v2.API_KEY"android:value="your api key"/><meta-dataandroid:name="com.google.android.gms.version"android:value="@integer/google_play_services_version" /><activityandroid:name="com.example.map.MainActivity"android:label="@string/app_name" ><intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter></activity></application>

it is right to write @integer/google_play_services_version in android values?

Yes. Check the version.xml in your res/values of library project. Will look like below.

<?xml version="1.0" encoding="utf-8"?><resources><integername="google_play_services_version">4030500</integer></resources>

All you need to do is reference the same as

 android:value="@integer/google_play_services_version" /> 
 // this is what should be in the application tag of manifest file

Post a Comment for "Android Google Map V2 Stopped"