Después de la actualización del servicio Google Play a la versión 13, recibí un error
¿Cómo puedo resolver este error?
Causado por: java.lang.illegalargumentexception 11-01 11:08:12.845: E/AndroidRuntime(28885): Causado por: java.lang.IllegalStateException: La etiqueta de metadatos en el AndroidManifest de tu aplicación.xml no tiene el valor correcto. Esperado 4030500 pero encontrado 0. Debe tener la siguiente declaración dentro del elemento:
google-play-services_lib Manifiesto:
<?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();
}
Registro de errores completo:
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
8 answers
Necesitas agregar lo siguiente en tu manifiesto:
<application>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
...
</application>
EDITAR:
Esta información se puede encontrar en el error logcat msg, así como en Configurar los servicios de Google Play (Gracias Brais Gabin)
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-09-06 11:47:44
@Benoit'a respuesta tiene la solución exacta estoy respondiendo con conocimiento adicional:
1. una forma en que Benoit respondió es agregar la siguiente etiqueta de aplicación interna de AndroidManifest.xml
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
2. podemos añadir directamente el código de versión como
<meta-data android:name="com.google.android.gms.version" android:value="4030500" />
4030500 es el código de versión que se almacena dentro de
Google-play-services_lib>res>valores>versión.xml
Me gusta
<integer name="google_play_services_version">4030500</integer>
Conclusión: Los últimos servicios de google play requieren un nombre de versión, que debe mencionarse usando <meta-data .. />
dentro de AndroidManifest.xml
Nota: Recomiendo encarecidamente usar 1st way
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-11-07 04:19:29
Algunas cosas cambiaron desde que hiciste esa pregunta. Si utilizas Google Play services 7.0 o posterior, Gradle fusionará automáticamente los manifiestos e incluirá los metadatos necesarios para ti.
Citando Ian Lake :
(...) Servicios de Google Play 7.0 también tiene otra función de ahorro de tiempo si estás usando Gradle: incluye automáticamente el
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
Entrada en tu AndroidManifest.xml para usted-no es necesario agregar manualmente it! Perfecto ejemplo de fusión simple de manifiestos donde las bibliotecas pueden agregar metadatos requeridos, receptores, permisos y cualquier otra cosa que hecho necesidad-una cosa menos para olvidar!
Nota: esto no se aplica a los servicios de juego completo o play-services-all-wear AARs-solo los AARs granulares lo tienen construido en.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-08-17 10:41:28
Solo asegúrese de agregar las siguientes dos etiquetas de metadatos al AndroidManifest de 'su' aplicación.xml
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR_API_KEY"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
Esta solución funcionó para mí.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-04-08 19:41:56
Importé mi proyecto existente de Eclipse a Android Studio, En Eclipse project Integers.xml
contenía un valor codificado como sigue
<integer name="google_play_services_version">5089000</integer>
Causando un conflicto de versión con la última versión de los Servicios de reproducción que está creando Android Studio. después de eliminar esta línea de Integers.xml
comenzó a funcionar para mí.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-07-08 12:06:27
He creado una versión "file".xml " en la carpeta res/values de la copia incluida de los servicios de Google y pegó el código:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<integer name="google_play_services_version">4030500</integer>
</resources>
La copia original perdió el archivo y resolvió mi problema
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-12-06 02:02:36
Si todavía tiene un error, pruebe este.
Me funcionó
<meta-data
tools:replace="android:value"
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-09-10 00:50:58
Añade <meta-data>
después de cerrar la etiqueta <application>
. Esto resolvió mi problema
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-02-21 17:36:26