您应用的 AndroidManifest.xml 中所需的元数据标记不存在. [英] A required meta-data tag in your app's AndroidManifest.xml does not exist.

查看:39
本文介绍了您应用的 AndroidManifest.xml 中所需的元数据标记不存在.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为安卓开发谷歌地图应用.

I am developing a google maps app for android.

但是,不知何故我的应用程序崩溃并给出如下错误:

But, somehow my application crashes giving an error like :

java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  

这是我的 AndroidManifest.xml 的样子:-

This is what my AndroidManifest.xml looks like:-

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.locations"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <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"/>
  <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>
  <permission android:name ="com.example.locations.permission.MAPS_RECEIVE" android:protectionLevel="signature"></permission>

  <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.locations.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

          <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyAZhJllASbTnrFta8hj55shKydSi0ks824"/>

    </application>

</manifest>

日志:-

01-09 12:29:35.249: E/AndroidRuntime(7448): Caused by: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  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 am using google maps for this app How can i resolve this?

推荐答案

manifest 的 application 标签中缺少以下内容.这是 Google Play 服务更新后的新要求.

Missing the below in application tag of manifest. This ia new requirement as of updated google play services.

检查主题将 Google Play 服务版本添加到您的应用清单 @

Check the topic Add the Google Play services version to your app's manifest @

https://developers.google.com/maps/documentation/android/start>

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

删除这个

<permission android:name ="com.example.locations.permission.MAPS_RECEIVE" android:protectionLevel="signature"></permission>

不需要

这篇关于您应用的 AndroidManifest.xml 中所需的元数据标记不存在.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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