我已经看到很多问题与此类似,但到目前为止没有人帮助过我。我从LogCat收到错误,告诉我我需要将权限添加到我的清单文件中。但是,它要求我添加的权限已经存在。提前感谢您的帮助。
清单
<?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错误
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"/>
答案 0 :(得分:6)
您拼错了权限
<uses-permission android:name="com.google.android.providers.gsf.permisson.READ_GSERVICES"/>
i
之前s
之前o
错过了{{1}}。
答案 1 :(得分:2)
在androidmanifest.xml文件中使用以下代码
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<permission
android:name="xx.xxxxxx.xxxxxxx.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="xx.xxxxxx.xxxxxxx.permission.MAPS_RECEIVE" />
<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-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
答案 2 :(得分:0)
您的包名错误尝试纠正
&lt; uses-permission android:name =“edu.bloomu.huskies.tsc71523.skatelogger.MAPS_RECEIVE”/&gt;
正确的是
&lt; uses-permission android:name =“edu.bloomu.huskies.tsc71523.skatespot.MAPS_RECEIVE”/&gt;
甚至尝试添加 gps权限
&lt; uses-permission android:name =“com.google.android.providers.gsf.permission.READ_GSERVICES”/&gt;