Google Maps V2 API 清单,问题。
Google Maps V2 API Manifest, issues.
我在使用 V2 google 地图使我的清单正确时遇到问题。我当前收到的 运行 时间来自 log cat 的错误是:
`java.lang.SecurityException: The Maps API requires the additional following permissions to be set in the AndroidManifest.xml to ensure a correct behaviour:
<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"/>`
现在我已经尝试了很多不同的方法来让它工作,但是到目前为止我一直没有成功。如果有人想看一下我的清单并帮助我,我们将不胜感激。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.examples.test.night" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<!-- Open GL for Google Maps -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="***********************"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<!-- Creating Permission to receive Google Maps -->
<permission
android:name="com.examples.test.night.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.examples.test.night.permission.MAPS_RECEIVE" />
<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="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" />
<activity
android:name=".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>
<activity
android:name=".MainActivity2Activity"
android:label="@string/title_activity_main_activity2" >
</activity>
</application>
</manifest>
再次感谢任何能提供帮助的人。
<uses-permission>
标签必须在 <application>
标签之外。
我在使用 V2 google 地图使我的清单正确时遇到问题。我当前收到的 运行 时间来自 log cat 的错误是:
`java.lang.SecurityException: The Maps API requires the additional following permissions to be set in the AndroidManifest.xml to ensure a correct behaviour:
<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"/>`
现在我已经尝试了很多不同的方法来让它工作,但是到目前为止我一直没有成功。如果有人想看一下我的清单并帮助我,我们将不胜感激。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.examples.test.night" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<!-- Open GL for Google Maps -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="***********************"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<!-- Creating Permission to receive Google Maps -->
<permission
android:name="com.examples.test.night.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.examples.test.night.permission.MAPS_RECEIVE" />
<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="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" />
<activity
android:name=".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>
<activity
android:name=".MainActivity2Activity"
android:label="@string/title_activity_main_activity2" >
</activity>
</application>
</manifest>
再次感谢任何能提供帮助的人。
<uses-permission>
标签必须在 <application>
标签之外。