我已使用以下步骤设置了地图视图:
清单:
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17"/>
<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"/>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="$$MY_KEY_IS_HERE$$"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
运行包含地图的活动时,我得到:
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="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
显然我已经设置了这些权限,那么我怎样才能找出真正的错误?
答案 0 :(得分:1)
替换
机器人:名称=&#34; com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE&#34;
与
机器人:名称=&#34; iceberg.infiniti.app.permission.MAPS_RECEIVE&#34;
希望这会有所帮助。