gpt4 book ai didi

android - 您应用的 AndroidManifest.xml 中的必需元数据标记不存在。

转载 作者:IT老高 更新时间:2023-10-28 23:07:55 30 4
gpt4 key购买 nike

我正在为安卓开发一个谷歌地图应用程序。

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

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

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

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

我正在为这个应用程序使用谷歌地图我该如何解决这个问题?

最佳答案

list 的应用程序标记中缺少以下内容。这是更新后的 google play 服务的新要求。

查看主题将 Google Play 服务版本添加到您的应用 list @

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>

不需要

关于android - 您应用的 AndroidManifest.xml 中的必需元数据标记不存在。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21014222/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com