32

My app is using Google Play Services for location. Also it is using Google Maps. Until today it worked fine but after Eclipse updating and also Google Play Services v13 installation, it is not working any more. Today I have performed several updates. - Android SDK Tools updated to 22.3 - Android SDK Platform Tools updated to 19 - Android SDK Build-tools updated to 19 - Google Play Services updated to 13 Also I have updated ADT

When I start the Application I am getting this error message:

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 <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

I have worked several times with Google Play Services and also this app has worked fine until now. I did not include any meta-data in the manifest ever.

I have tried to fix the problem including the meta-data tag in my app manifest but it is not working. Currently my app manifest looks like this (this is the same one that the manifest included in my app when it worked).

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp.app"
android:versionCode="2"
android:versionName="1.0.1" >

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<permission
android:name="com.myapp.app.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />

<uses-permission android:name="com.myapp.app.permission.MAPS_RECEIVE" />

<supports-screens android:requiresSmallestWidthDp="320" />
<supports-screens android:compatibleWidthLimitDp="394" />


<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="18" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomizedTheme" >

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

<activity
android:name="com.myapp.app.ActivityMain"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
    </activity>
</application>

</manifest>

I am wondering if this issue is due to the google-play-services manifest?

This is the manifest I have found:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.gms"
android:versionCode="4030530"
android:versionName="4.0.30 (889083-30)" >

<uses-sdk android:minSdkVersion="8"/>

</manifest>

To use the Google Play Services I have followed the instructions given by Google, as in the past and until now I have not found any problem.

elarcoiris
  • 1,914
  • 4
  • 28
  • 30
  • possible duplicate of [After Google Play Service update to version 13 I got an error](http://stackoverflow.com/questions/19723811/after-google-play-service-update-to-version-13-i-got-an-error) – laalto Nov 02 '13 at 17:46

3 Answers3

71

The Google Maps getting started guide says:

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" />
meh
  • 22,090
  • 8
  • 48
  • 58
  • 1
    I have tried this solution but although the application does not crash it is not working becasue the latest version of Google Play available is the revision 12. It seems is not ready yet. I have used the Google Play service for Froyo and it works. So far I will use this. I any case thanks a lot for your help –  Nov 02 '13 at 15:42
  • yea it looks like something new they have added, will add that as well after i update the play services library. – meh Nov 02 '13 at 22:52
  • 1
    In the Logcat error, you can see what number you have to put in value field of that meta data, and it is NOT the revision number (last is 13), check it out. – danigonlinea Nov 04 '13 at 11:51
  • 1
    You need to have both in the manifest. 1.for the Goolge API Key 2.for google_play_services_version. – Raj Trivedi Jan 29 '14 at 10:01
7

if you use google play service revision 13 then must put this meta tag:

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

but it not work lower level api like android 2.*. to resolve this problem first install google play service for frayo revision 12 and use it. it works on all api level

Roman Holzner
  • 5,738
  • 2
  • 21
  • 32
1

@Javier Did you see the post on "android developers blog" ? They updated google play service app last week. So, Version code is suitable for lib now. It works well. We can use the latest version of "google-play-service-lib" now. I tested it and it works! See this https://android-developers.googleblog.com/2014/01/google-play-services-41.html

MatPag
  • 41,742
  • 14
  • 105
  • 114
cmcromance
  • 2,289
  • 1
  • 25
  • 26