谷歌播放服务V13错误的元数据AndroidManifest [英] Google Play Services v13 error meta-data in AndroidManifest

查看:184
本文介绍了谷歌播放服务V13错误的元数据AndroidManifest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用谷歌播放服务的位置。同时它使用谷歌地图。直到今天它工作得很好,但Eclipse的更新后,也谷歌播放服务V13的安装,它是不工作了。今天,我已经进行了多次更新。 - Android的SDK工具更新为22.3 - Android的SDK平台的工具更新为19 - Android SDK中内建工具,更新至19 - 谷歌游戏服务更新为13 此外,我已经更新ADT

当我开始我收到此错误信息的应用程序:

  java.lang.IllegalStateException:在您的应用程序的Andr​​oidManifest.xml中的元数据标签没有正确的价值。
预计4030500但发现0。你必须在&lt中的以下声明;用途>元:其中,元数据的android:NAME =com.google.android.gms.version机器人:值=@整数/ google_play_services_version/>
 

我曾数次与谷歌播放服务,并同时这个程序一直很好,直到如今。我并没有包括在清单中过任何元数据。

我已经尝试,包括在我的应用程序清单中的元数据标签的问题,但它不工作。目前,我的应用程序清单如下(这是同一个清单包括在我的应用程序的时候,它的工作)。

 < XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
包=com.myapp.app
安卓版code =2
机器人:VERSIONNAME =1.0.1>

<用途特征
机器人:glEsVersion =0x00020000
机器人:要求=真/>

<使用-权限的Andr​​oid:名称=android.permission.INTERNET对/>
<使用-权限的Andr​​oid:名称=android.permission.ACCESS_NETWORK_STATE/>
<使用-权限的Andr​​oid:名称=android.permission.WRITE_EXTERNAL_STORAG​​E/>
<使用-权限的Andr​​oid:名称=com.google.android.providers.gsf.permission.READ_GSERVICES/>
<使用-权限的Andr​​oid:名称=android.permission.ACCESS_COARSE_LOCATION/>
<使用-权限的Andr​​oid:名称=android.permission.ACCESS_FINE_LOCATION/>
<许可
机器人:名称=com.myapp.app.permission.MAPS_RECEIVE
安卓的ProtectionLevel =签名/>

<使用-权限的Andr​​oid:名称=com.myapp.app.permission.MAPS_RECEIVE/>

<支持屏安卓requiresSmallestWidthDp =320/>
<支持屏安卓compatibleWidthLimitDp =394/>


<用途-SDK
安卓的minSdkVersion =16
机器人:targetSdkVersion =18/>

<应用
机器人:allowBackup =真
机器人:图标=@可绘制/ ic_launcher
机器人:标签=@字符串/ APP_NAME
机器人:主题=@风格/ CustomizedTheme>

&所述;元数据
机器人:名称=com.google.android.maps.v2.API_KEY
机器人:值=的code/>

<活动
机器人:名称=com.myapp.app.ActivityMain
机器人:标签=@字符串/ APP_NAME>
<意向滤光器>
<作用机器人:名称=android.intent.action.MAIN/>
<类机器人:名称=android.intent.category.LAUNCHER/>
&所述; /意图滤光器>
    < /活性GT;
< /用途>

< /舱单>
 

我想知道如果这个问题是由于谷歌播放-服务清单?

这是我发现的清单:

 < XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
包=com.google.android.gms
安卓版code =4030530
机器人:VERSIONNAME =4.0.30(889083-30)>

<使用-SDK安卓的minSdkVersion =8/>

< /舱单>
 

要使用谷歌播放服务我跟随由谷歌提供的说明,因为在过去,到现在为止我还没有发现任何问题。

解决方案

谷歌地图入门指南说:

添加了谷歌播放服务版本的应用程序的清单

  

编辑应用程序的Andr​​oidManifest.xml文件,并添加   继元素中声明。这将嵌入   谷歌的播放服务,应用程序编译时使用的版本。

 <元数据
        机器人:名称=com.google.android.gms.version
        机器人:值=@整数/ google_play_services_version/>
 

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.

解决方案

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

这篇关于谷歌播放服务V13错误的元数据AndroidManifest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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