0

I'm running an app in production making use of Google Maps Android API v2 using support library, and just glancing over reference docs from Google I noticed I'm missing the following line:

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

https://developers.google.com/maps/documentation/android/start#add_the_google_play_services_version_to_your_apps_manifest

Google documention seems to be missing explanation of this key.

How important is it to include the version in the manifest and what does it accomplish?

Thanks.

AlexVPerl
  • 7,652
  • 8
  • 51
  • 83
  • [http://stackoverflow.com/questions/19735507/google-play-services-v13-error-meta-data-in-androidmanifest](http://stackoverflow.com/questions/19735507/google-play-services-v13-error-meta-data-in-androidmanifest) – M D Apr 30 '15 at 04:57
  • If you don't include this, your map will not work. this is high priority – Yurets Apr 30 '15 at 04:59
  • it's compulsory to add in your manifest other wise map will not work.also you have to use latest google play service not old one. – Jignesh Jain Apr 30 '15 at 05:02

3 Answers3

1

AFAIK it is needed to tell the Android framework and the playstore the version of the play services library against which you have complied your app and I guess it will be required to track if any new features (or deprecated features) are being used by you app.

You can see now some apps wont work unless we update the google play services in our device which clearly shows us that if an app compiled with a newer version of play services lib the device must have the same or above version of the play store apk in order to run the app this maybe due to security and feature dependency on the new play services(ie.. GoogleDrive API, Google+ API,Google auto API ).

  • Thanks for a detailed explanation. I obviously need to add this. I'm trying to assess the current damage as the app is in production. Do you know what happens if the user has an old version, does the App crash, does it get filtered out by Google Play, or does it simply not show the map view ? Also how do I know what version to set it to ? – AlexVPerl Apr 30 '15 at 05:21
  • If you handle the error as described here (http://developer.android.com/google/play-services/setup.html#ensure) it will call the startResolutionForResult() (http://developer.android.com/reference/com/google/android/gms/common/ConnectionResult.html#startResolutionForResult(android.app.Activity, int)) which takes the necessary steps to resolve the error. – Vigneshwaran Murugesan Apr 30 '15 at 05:25
  • the problem I'm getting is Error:(146, 28) No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). – AlexVPerl Apr 30 '15 at 18:44
0

This is just to tell the DVM which google play service version in using your device. if you are not specifying it then it will crash your application because didn't come to know about the version. I'm also wondering how google didn't specify this in documention. But it is necessary to specify this.

Sahil Garg
  • 263
  • 1
  • 20
  • Thanks for explaining. What do I set it to then, I have minSdkVersion="10" in the manifest ? – AlexVPerl Apr 30 '15 at 05:15
  • This is not about sdk version its about google sdk version which is already specified in the google play service library – Sahil Garg Apr 30 '15 at 05:17
  • That makes sense as its a separate lib. How do I know or where do I look up what value to set it to in the manifest though ? – AlexVPerl Apr 30 '15 at 05:23
  • You dont have to set seprately its value, you just have to add google play service library in your project and then it will automatically get that value from it – Sahil Garg Apr 30 '15 at 05:25
0

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.

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

An Android application that uses the Google Maps Android API should specify the following settings in its manifest file, AndroidManifest.xml:

the first one is:

• A reference to the Google Play services version. If you have followed the steps on this page up to this point, you have already added the required declaration to your application manifest.

• ... ...

Community
  • 1
  • 1
Xcihnegn
  • 11,579
  • 10
  • 33
  • 33