在第2版地图视图不显示地图 [英] In Version 2 Map view does not show map
本文介绍了在第2版地图视图不显示地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
地图活动不显示地图,它的出现只是白色屏幕缩放控制按钮。 清单文件是这样的:
Map Activity doesn't showing map, it's appear as just white screen with zoom control buttons. Manifest File like this :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.demomap"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<permission
android:name="com.example.demomap.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.demomap.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" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.demomap.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.maps.v2.API_KEY"
android:value="AIzaSyCTQZOcXFS3RpNSVe79HHN1xojat-2MbT4" />
</application>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
</manifest>
我的XML文件,就像这些:
My XmL File Like these:
<?xml version="1.0" encoding="utf-8"?>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
登录猫错误:
Log Cat Error:
05-15 17:15:16.255: E/Google Maps Android API(26201): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
请帮我。
推荐答案
也许关键是不正确的。你可以尝试以下的事情:
Maybe the key isn't correct. You can try the following thing:
- Be sure you Enter your right Package name like this
- Test on a real device which updated latest google play. Or use emulator with this guide
Active google map api v2 for android at google console site
这篇关于在第2版地图视图不显示地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文