gpt4 book ai didi

android - Google Maps Android v2 授权失败

转载 作者:太空宇宙 更新时间:2023-11-03 13:30:38 25 4
gpt4 key购买 nike

我正在一台装有 2.3.6 的实际设备上测试示例 google 代码。我认为这可能是 key 的问题,所以我通过 Google 的 API 控制台在不同的帐户上创建了不同的 key 。仍然是同样的问题“Google Maps Android API-授权失败”。这是日志:

12-07 10:31:30.476: D/dalvikvm(17791): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp
12-07 10:31:30.484: W/dalvikvm(17791): VFY: unable to resolve instance field 24
12-07 10:31:30.484: D/dalvikvm(17791): VFY: replacing opcode 0x52 at 0x0012
12-07 10:31:30.484: D/dalvikvm(17791): VFY: dead code 0x0014-0018 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b (Landroid/content/res/Resources;)Z
12-07 10:31:30.718: D/dalvikvm(17791): GC_CONCURRENT freed 197K, 46% free 3063K/5639K, external 408K/517K, paused 3ms+4ms
12-07 10:31:30.789: W/dalvikvm(17791): Unable to resolve superclass of Lmaps/a/du; (411)
12-07 10:31:30.789: W/dalvikvm(17791): Link of class 'Lmaps/a/du;' failed
12-07 10:31:30.789: W/dalvikvm(17791): Unable to resolve superclass of Lmaps/a/ej; (2363)
12-07 10:31:30.789: W/dalvikvm(17791): Link of class 'Lmaps/a/ej;' failed
12-07 10:31:30.789: W/dalvikvm(17791): Unable to resolve superclass of Lmaps/j/k; (2379)
12-07 10:31:30.789: W/dalvikvm(17791): Link of class 'Lmaps/j/k;' failed
12-07 10:31:30.789: E/dalvikvm(17791): Could not find class 'maps.j.k', referenced from method maps.y.ae.a
12-07 10:31:30.789: W/dalvikvm(17791): VFY: unable to resolve new-instance 3571 (Lmaps/j/k;) in Lmaps/y/ae;
12-07 10:31:30.789: D/dalvikvm(17791): VFY: replacing opcode 0x22 at 0x007d
12-07 10:31:30.820: D/dalvikvm(17791): VFY: dead code 0x007f-008f in Lmaps/y/ae;.a (Landroid/view/LayoutInflater;Lcom/google/android/gms/maps/GoogleMapOptions;Z)Lmaps/y/ae;
12-07 10:31:31.281: D/dalvikvm(17791): GC_CONCURRENT freed 297K, 46% free 3222K/5959K, external 408K/517K, paused 3ms+4ms
12-07 10:31:31.523: D/dalvikvm(17791): GC_EXTERNAL_ALLOC freed 227K, 45% free 3397K/6087K, external 431K/517K, paused 52ms
12-07 10:31:31.648: I/System.out(17791): 0
12-07 10:31:31.734: D/dalvikvm(17791): GC_CONCURRENT freed 188K, 43% free 3531K/6151K, external 544K/1029K, paused 5ms+4ms
12-07 10:31:32.125: D/libEGL(17791): loaded /system/lib/egl/libGLES_hgl.so
12-07 10:31:32.132: D/BRCM_EGL(17791): eglCreateContext() context: 0xd7090, VC context 1, Thread 17810
12-07 10:31:32.148: D/BRCM_EGL(17791): eglCreateWindowSurface() surface: 0xd70d0, VC surface: 1, Thread: 17810
12-07 10:31:32.148: D/BRCM_EGL(17791): eglMakeCurrent(0xd7090, 0xd70d0, 0xd70d0) Thread: 17810
12-07 10:31:32.859: E/Google Maps Android API(17791): Authorization failure.

这是我的 list :

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.smartapps4u.googlemapslib"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<permission
android:name="com.smartapps4u.googlemapslib.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.smartapps4u.googlemapslib.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<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-library android:name="com.google.android.maps" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="My API key"/>

<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

</manifest>

如有任何帮助,我们将不胜感激。

最佳答案

解决了。我犯了一个非常愚蠢的错误。使用了错误的 api key 。将 api key 用于已签名的应用程序。将其替换为用于调试 keystore 的 api key 并解决了问题。

关于android - Google Maps Android v2 授权失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13757362/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com