我正在尝试加载地图。地图元素如缩放,位置等已加载,但地图未显示
我添加了api键和地图所需的其他内容。
我将logcat设为:The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
以下是我的清单Xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blah.blahh"
android:versionCode="1"
android:versionName="1.0" >
<permission android:name="com.xxx.xxx.permission.MAPS_RECEIVE"
android:protectionLevel="signature"></permission>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<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.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
.
.
.
</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="AIzaXXXxXXXXXXXXXX7mSf-THX" />
</application>
</manifest>
欢迎任何有关此事的想法
答案 0 :(得分:3)
在清单中包含此内容
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
请确保您已在项目中添加了Google Play商店库项目。
还要确保添加了与您的应用签名相对应的地图api密钥
答案 1 :(得分:0)
为获取API密钥而提供的包名可能会更改。确保使用的包名称正确