google maps V2 “Unfortunately app has Stopped”

2019-02-20 23:53发布

问题:

I just begin to learn Android .take 4 days to try work maps view but not work .that error Unfortunately the app has stopped

回答1:

There are some things you need to check:

1. Is the SHA1 fingerprint is ok that you have registered in google api console.For how to find it , you can find it here

2. The generated api_key must be same with the menifest.

3. Name of the app in api console must be same with the name of app in strings.xml.

4. meta-data must have to be included in menifest.

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


I recommend you to follow this link.It is awesome and it will take just 1 hour for you to map working.



回答2:

For google map to work add below lines to your manifest -

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

and import google play service library to your workspace.