Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After Google Play Service update to version 13 I got an error

How can I resolve this error?

Caused by: java.lang.illegalargumentexception 11-01 11:08:12.845: E/AndroidRuntime(28885): 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:


google-play-services_lib Manifest:

<?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> 


public void loginGooglePlus() {     aHelper.setup(this, GameHelper.CLIENT_APPSTATE | GameHelper.CLIENT_GAMES);     mHelper = aHelper.getAppStateClient();     //crash is here     mHelper.connect(); } 


Full error log:

11-01 11:38:13.507: E/AndroidRuntime(31297): FATAL EXCEPTION: main 11-01 11:38:13.507: E/AndroidRuntime(31297): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.company.application.android.aja/com.company.application.android.aja.BeetleBattleAndroidActivity}: 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" /> 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2077) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.app.ActivityThread.access$600(ActivityThread.java:134) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.os.Handler.dispatchMessage(Handler.java:99) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.os.Looper.loop(Looper.java:154) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.app.ActivityThread.main(ActivityThread.java:4624) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at java.lang.reflect.Method.invokeNative(Native Method) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at java.lang.reflect.Method.invoke(Method.java:511) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:965) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:732) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at dalvik.system.NativeStart.main(Native Method) 11-01 11:38:13.507: E/AndroidRuntime(31297): 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 <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 11-01 11:38:13.507: E/AndroidRuntime(31297):    at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at com.google.android.gms.internal.de.connect(Unknown Source) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at com.google.android.gms.appstate.AppStateClient.connect(Unknown Source) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at com.company.application.android.aja.BeetleBattleAndroidActivity.loginGooglePlus(BeetleBattleAndroidActivity.java:153) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at com.company.application.android.aja.BeetleBattleAndroidActivity.onCreate(BeetleBattleAndroidActivity.java:143) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.app.Activity.performCreate(Activity.java:4509) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050) 11-01 11:38:13.507: E/AndroidRuntime(31297):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2041) 11-01 11:38:13.507: E/AndroidRuntime(31297):    ... 11 more 
like image 531
Igor Kostenko Avatar asked Nov 01 '13 09:11

Igor Kostenko


People also ask

Why is my Google Play service not updating?

All you need to do is a clear the cache for Play Services and Play Store. If the problem continues, then try clearing data for them as well. Rest assured, clearing cache or data will not remove apps or delete data from your phone. However, clearing Play Store data will reset its settings to default.

Why does my Google Play Services keep stopping?

For applications in our android phones to work perfectly, they need to be updated. This helps maximize the full potentials of that app. The reason why your google play services keep stopping may be because the app is not updated.


2 Answers

You need to add the following in your manifest:

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

EDIT:

This information can be found in the logcat error msg as well as on Setting Up Google Play Services (Thanks Brais Gabin)

like image 152
Benoit Avatar answered Oct 02 '22 03:10

Benoit


@Benoit'a answer has exact solution i am answering with additional knowledge:

1. one way as Benoit answered is add following inside application tag of AndroidManifest.xml

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

2. we can directly add the version code like

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

4030500 is version code which is stored inside

google-play-services_lib>res>values>version.xml

Like

<integer name="google_play_services_version">4030500</integer> 

Conclusion: Latest google play services requires a version name, which is to be mentioned using <meta-data .. /> inside AndroidManifest.xml

Note: I would strongly recommend to use 1st way

like image 25
Tarsem Singh Avatar answered Oct 02 '22 03:10

Tarsem Singh