AndroidManifest 中的 Google Play Services v13 错误元数据 [英] Google Play Services v13 error meta-data in AndroidManifest

查看:34
本文介绍了AndroidManifest 中的 Google Play Services v13 错误元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用正在使用 Google Play 服务获取位置信息.它还使用谷歌地图.直到今天,它运行良好,但在 Eclipse 更新和 Google Play Services v13 安装之后,它不再工作了.今天我进行了几次更新.- Android SDK 工具更新至 22.3- Android SDK 平台工具更新至 19- Android SDK Build-tools 更新至 19- Google Play 服务更新至 13我也更新了 ADT

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" />

我曾多次使用 Google Play 服务,而且这个应用程序至今运行良好.我从来没有在清单中包含任何元数据.

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>

我想知道这个问题是否是由 google-play-services 清单引起的?

I am wondering if this issue is due to the google-play-services 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>

为了使用 Google Play 服务,我一直按照 Google 提供的说明进行操作,就像过去一样,直到现在我都没有发现任何问题.

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.

推荐答案

Google 地图入门指南 说:

将 Google Play 服务版本添加到您的应用清单

编辑您的应用程序的 AndroidManifest.xml 文件,并添加元素内的以下声明.这嵌入编译应用时使用的 Google Play 服务版本.

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" />

这篇关于AndroidManifest 中的 Google Play Services v13 错误元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆