本文介绍了之后谷歌Play业务更新到版本13我得到了一个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我该如何解决这个问题?
谷歌播放services_lib清单:
< XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=http://schemas.android.com/apk/res/android
包=com.google.android.gms
安卓版code =4030530
机器人:VERSIONNAME =4.0.30(889083-30)>
<使用-SDK安卓的minSdkVersion =8/>
< /舱单>
公共无效loginGooglePlus(){
aHelper.setup(这一点,GameHelper.CLIENT_APPSTATE | GameHelper.CLIENT_GAMES);
mHelper = aHelper.getAppStateClient();
//崩溃就在这里
mHelper.connect();
}
完全错误日志:
一十一月11日至1号:38:13.507:E / AndroidRuntime(31297):致命异常:主要
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):java.lang.RuntimeException的:无法启动的活动ComponentInfo{com.company.application.android.aja/com.company.application.android.aja.BeetleBattleAndroidActivity}: java.lang.IllegalStateException:在您的应用程序的AndroidManifest.xml中的元数据标签没有正确的价值。预计4030500但发现0。你必须在&lt中的以下声明;用途>元:其中,元数据的android:NAME =com.google.android.gms.version机器人:值=@整数/ google_play_services_version/>
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2077)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.app.ActivityThread.access $ 600(ActivityThread.java:134)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1247)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.os.Handler.dispatchMessage(Handler.java:99)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.os.Looper.loop(Looper.java:154)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.app.ActivityThread.main(ActivityThread.java:4624)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在java.lang.reflect.Method.invokeNative(本机方法)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在java.lang.reflect.Method.invoke(Method.java:511)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:965)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:732)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在dalvik.system.NativeStart.main(本机方法)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):java.lang.IllegalStateException:在您的应用程序的AndroidManifest.xml中的元数据标签没有正确的价值所致。预计4030500但发现0。你必须在&lt中的以下声明;用途>元:其中,元数据的android:NAME =com.google.android.gms.version机器人:值=@整数/ google_play_services_version/>
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在com.google.android.gms.common.GooglePlayServicesUtil.n(来源不明)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(来源不明)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在com.google.android.gms.internal.de.connect(来源不明)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在com.google.android.gms.appstate.AppStateClient.connect(来源不明)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在com.company.application.android.aja.BeetleBattleAndroidActivity.loginGooglePlus(BeetleBattleAndroidActivity.java:153)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在com.company.application.android.aja.BeetleBattleAndroidActivity.onCreate(BeetleBattleAndroidActivity.java:143)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.app.Activity.performCreate(Activity.java:4509)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2041)
十一月11日至一号:38:13.507:E / AndroidRuntime(31297):11 ...更多
解决方案
您需要添加在你的清单如下:
<应用>
&所述;元数据
机器人:名称=com.google.android.gms.version
机器人:值=@整数/ google_play_services_version/>
...
< /用途>
编辑:
这信息可以在logcat的错误味精以及对设置谷歌播放服务中找到的(感谢Brais加宾)的
How can I resolve this error?
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
解决方案
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)
这篇关于之后谷歌Play业务更新到版本13我得到了一个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!