我正在尝试制作一个使用地图的简单应用程序。在输出中不可见的所有编码地图完成后。只有放大和 zzomout 按钮可见
下面是清单文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.map1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<permission
android:name="com.example.map1.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.map1.permission.MAPS_RECEIVE"/>
<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" />
<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="com.example.map1.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="AIzaSyBoSLfTOWdAny2vrtwMx6lFTuWdoyANJlQ"/>
</application>
</manifest>
下面是xml文件
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/the_map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"
map:cameraTilt="45"
map:cameraZoom="14"
/>
我正在 HTC 1x 上测试我的应用程序。
这是logcat
08-27 00:24:10.419: I/(3812): Loading GLESv1_CM implementation /system/lib//egl/libGLESv1_CM_tegra_impl
08-27 00:24:12.284: I/Google Maps Android API(3812): Failed to contact Google servers. Another attempt will be made when connectivity is established.
08-27 00:24:27.739: E/Google Maps Android API(3812): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).