谷歌Android地图API第2版 - 需要许可,它已经拥有 [英] Android Google Maps API v2 - Requires permission that it already has

查看:163
本文介绍了谷歌Android地图API第2版 - 需要许可,它已经拥有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了很多问题发布与此类似,但到目前为止都没有帮助我。我碰到LogCat中告诉我,我需要被添加到我的清单文件权限的错误。然而,它的要求我添加的权限已经存在。感谢您事先的任何帮助。

清单

 <?XML版本=1.0编码=UTF-8&GT?;
<清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    包=edu.bloomu.huskies.tsc71523.skatespot
    安卓版code =1
    机器人:=的versionName1.0>    <用途-SDK
        安卓的minSdkVersion =8
        机器人:targetSdkVersion =18/>    <允许机器人:名字=edu.bloomu.huskies.tsc71523.skatelogger.MAPS_RECEIVE
        安卓的ProtectionLevel =签名/>    <使用许可权的android:NAME =edu.bloomu.huskies.tsc71523.skatelogger.MAPS_RECEIVE/>
    <使用许可权的android:NAME =com.google.android.providers.gsf.permisson.READ_GSERVICES/>
    <使用许可权的android:NAME =android.permission.INTERNET对/>
    <使用许可权的android:NAME =android.permission.ACCESS_NETWORK_STATE/>
    <使用许可权的android:NAME =android.permission.WRITE_EXTERNAL_STORAG​​E/>    <用途特征
        机器人:glEsVersion =0x00020000
        机器人:要求=真/>    <应用
        机器人:allowBackup =真
        机器人:图标=@绘制/ ic_launcher
        机器人:标签=@字符串/ APP_NAME
        机器人:主题=@风格/ AppTheme>
        <活动
            机器人:名字=edu.bloomu.huskies.tsc71523.skatelogger.MainActivity
            机器人:标签=@字符串/ APP_NAME>
            &所述;意图滤光器>
                <作用机器人:名字=android.intent.action.MAIN/>                <类机器人:名字=android.intent.category.LAUNCHER/>
            &所述; /意图滤光器>
        < /活性GT;        <元数据机器人:名字=com.google.android.gms.version
            机器人:值=@整数/ GOOGLE_PLAY_SERVICES_VERSION/>        <元数据机器人:名字=com.google.android.maps.v2.API_KEY
            机器人:值=编辑/>    < /用途>< /清单>

LogCat中错误

 产生的原因:java.lang.SecurityException异常:地​​图API需要额外以下权限在AndroidManifest.xml中设置,以确保正确的行为:
<使用许可权的android:NAME =com.google.android.providers.gsf.permission.READ_GSERVICES/>


解决方案

您拼错的允许

<使用许可权的android:NAME =com.google.android.providers.gsf.permisson.READ_GSERVICES/>

你缺少一个 I 取值,在 0

I've seen a lot of questions posted similar to this but none have helped me so far. I'm getting an error from LogCat that tells me I require a permission to be added to my manifest file. However the permission it's asking me to add is already there. Thanks in advance for any help.

Manifest

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="edu.bloomu.huskies.tsc71523.skatespot"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <permission android:name="edu.bloomu.huskies.tsc71523.skatelogger.MAPS_RECEIVE"
        android:protectionLevel="signature"/>

    <uses-permission android:name="edu.bloomu.huskies.tsc71523.skatelogger.MAPS_RECEIVE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permisson.READ_GSERVICES"/>
    <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-feature 
        android:glEsVersion="0x00020000"
        android:required="true"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="edu.bloomu.huskies.tsc71523.skatelogger.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.gms.version" 
            android:value="@integer/google_play_services_version" />

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

    </application>

</manifest>

LogCat Error

Caused by: java.lang.SecurityException: The Maps API requires the additional following permissions to be set in the AndroidManifest.xml to ensure a correct behavior: 
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>

解决方案

You misspelled permission

<uses-permission android:name="com.google.android.providers.gsf.permisson.READ_GSERVICES"/>

you are missing an i after the s, before the o.

这篇关于谷歌Android地图API第2版 - 需要许可,它已经拥有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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