Google Map is not loading due to inflate exception

前端 未结 3 1576
無奈伤痛
無奈伤痛 2021-01-17 02:29

I am using Google Maps v2 in my application. The key is correctly generated, all the permissions exist in manifest. I followed the tutorial of Google Maps v2. I followed eac

3条回答
  •  醉梦人生
    2021-01-17 03:09

    Your logcat clearly said

     03-04 01:25:23.293: E/AndroidRuntime(19467): 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:      03-04
     01:25:23.293: E/AndroidRuntime(19467):
    

    Add the Google Play services version to your app's manifest

    Edit your application's AndroidManifest.xml file, and add the following declaration within the element. This embeds the version of Google Play services that the app was compiled with.

    You need to add under tag into your AndroidManifest.xml

    ....
     
     
    

    This is because latest google play services requires a version name, which is to be mentioned using inside AndroidManifest.xml

    and also change MainActivity extends Activity

    For more information go to :https://developers.google.com/maps/documentation/android

提交回复
热议问题