我正在尝试将 Android 地图版本 2 集成到我的应用程序中。我从这个链接提供的例子开始
https://developers.google.com/maps/documentation/android/intro#sample_code
我收到授权失败异常。
以下文字来自 logcat
01-30 22:51:25.953: D/GestureDetector(5418): Change mBiggerTouchSlopSquare from 400 to 729
01-30 22:51:26.003: D/dalvikvm(5418): GC_CONCURRENT freed 793K, 19% free 3832K/4707K, paused 2ms+2ms
01-30 22:51:26.023: I/global(5418): call createSocket() return a new socket.
01-30 22:51:26.063: D/libEGL(5418): loaded /system/lib/egl/libGLES_android.so
01-30 22:51:26.083: D/libEGL(5418): loaded /system/lib/egl/libEGL_adreno200.so
01-30 22:51:26.083: D/libEGL(5418): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
01-30 22:51:26.083: D/libEGL(5418): loaded /system/lib/egl/libGLESv2_adreno200.so
01-30 22:51:26.103: I/Adreno200-EGLSUB(5418): <ConfigWindowMatch:2087>: Format RGBA_8888.
01-30 22:51:26.123: D/memalloc(5418): ion: Mapped buffer base:0x53a22000 size:3768320 offset:0 fd:93
01-30 22:51:26.143: D/OpenGLRenderer(5418): Enabling debug mode 0
01-30 22:51:26.173: I/Adreno200-EGLSUB(5418): <ConfigWindowMatch:2098>: Format RGBX_8888.
01-30 22:51:26.203: D/memalloc(5418): ion: Mapped buffer base:0x543d7000 size:3391488 offset:0 fd:97
01-30 22:51:26.243: D/memalloc(5418): ion: Mapped buffer base:0x54c96000 size:3768320 offset:0 fd:100
01-30 22:51:26.293: D/memalloc(5418): ion: Mapped buffer base:0x55156000 size:3768320 offset:0 fd:103
01-30 22:51:26.323: D/dalvikvm(5418): GC_FOR_ALLOC freed 1359K, 31% free 4020K/5795K, paused 17ms
****01-30 22:51:26.333: E/Google Maps Android API(5418): Authorization failure.****
01-30 22:51:26.373: D/memalloc(5418): ion: Mapped buffer base:0x55560000 size:3391488 offset:0 fd:106
01-30 22:51:26.393: D/memalloc(5418): ion: Mapped buffer base:0x558ac000 size:3391488 offset:0 fd:109
有人可以向我提供有关如何解决此问题的信息吗?如果这是一个微不足道的问题,我很抱歉,我是 Android 应用程序开发的新手。
Android 清单文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.googlemapsdemo"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<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.googlemapsdemo.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="my api key"/>
</application>
<permission
android:name="com.googlemapsdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.googlemapsdemo.permission.MAPS_RECEIVE"/>
</manifest>