Skip to main content

Meta-Data tag updates with MAP API v2

Caused by: java.lang.IllegalStateException: The meta-data tag in
your app's AndroidManifest.xml does not have the right value. Expected
4030500 but found 0. You must have the following declaration within the
element: <meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
If you get this type of error while launch your application which is based on Google Map V2,then update your AndroidMenifest.xml file.

Solution
- Google Play Services have been updated to 4.0.30 very recently and so you seem to be using that version of google-play-services_lib. Assumption based on this line:

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


Not all devices have received an update of GooglePlayServices.APK, which needs to be at least the   same version as a client library you are using.
Check version of GPServices.APK in Settings app. For me it is still at 3.2.66 and last time I had to wait few days for the update.
If you are using gradle, you can put lower version dependency. If not, you have to download older version of google-play-services_lib from somewhere.

For more details refer this google document. It's a new requirement added from the last revision 13 update to google-play-services.

Note:
After Adding this tag, if you get this error like:
No resources found that match the given name (at 'value' with value '@integer/ google_play_services_version').

Solution
- It is probably that your library is not linked to project properly or that you have older google-play-services library version so conflict appears and Eclipse got stupid..  :)
You don't need to add anything in integers.xml. When you link properly Google-play-services library to your project reference b will be found and you are ready to go. When you add library to your project just do one more clean so funny Eclipse environment sweep-out things properly.
If you hardcode somewhere this number when next play version come you would need to update it. And if you forget that, you will spend time again looking for bug..  :)

Comments