gpt4 book ai didi

Android 谷歌地图未显示在模拟器上

转载 作者:行者123 更新时间:2023-11-29 22:22:38 27 4
gpt4 key购买 nike

我正在尝试实现这个例子 http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html我已经完全按照所有步骤进行操作,但在模拟器中, map 没有显示,它只显示框。有人知道我在做什么错吗?下面是 Logcat

这是我的 list 文件,

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gmap.com"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".GmapActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps" />

</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

主.xml

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:enabled="true"
android:apiKey="0YjDTTmg77HeTG-dfdfdfdfdWovpPSnatfUTrp5MQ"
/>
</LinearLayout>

日志

 07-20 12:55:21.688: DEBUG/AndroidRuntime(389): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
07-20 12:55:21.688: DEBUG/AndroidRuntime(389): CheckJNI is ON
07-20 12:55:22.086: DEBUG/AndroidRuntime(389): --- registering native functions ---
07-20 12:55:23.576: DEBUG/AndroidRuntime(389): Shutting down VM
07-20 12:55:23.597: DEBUG/dalvikvm(389): Debugger has detached; object registry had 1 entries
07-20 12:55:24.396: DEBUG/AndroidRuntime(397): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
07-20 12:55:24.396: DEBUG/AndroidRuntime(397): CheckJNI is ON
07-20 12:55:24.686: DEBUG/AndroidRuntime(397): --- registering native functions ---
07-20 12:55:26.046: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=gmap.com/.GmapActivity }
07-20 12:55:26.156: DEBUG/AndroidRuntime(397): Shutting down VM
07-20 12:55:26.168: DEBUG/dalvikvm(397): Debugger has detached; object registry had 1 entries
07-20 12:55:26.215: INFO/AndroidRuntime(397): NOTE: attach of thread 'Binder Thread #3' failed
07-20 12:55:26.826: WARN/MapActivity(337): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispatcher@44ef1a08
07-20 12:55:26.856: VERBOSE/MapActivity(337): Recycling map object.
07-20 12:55:27.146: INFO/MapActivity(337): Handling network change notification:CONNECTED
07-20 12:55:27.186: ERROR/MapActivity(337): Couldn't get connection factory client
07-20 12:55:27.416: INFO/ActivityManager(59): Displayed activity gmap.com/.GmapActivity: 964 ms (total 964 ms)
07-20 12:55:27.965: WARN/InputManagerService(59): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@44ee5428 (uid=10034 pid=353)
07-20 12:55:33.666: DEBUG/dalvikvm(353): GC_EXPLICIT freed 9539 objects / 509864 bytes in 180ms

最佳答案

好吧,这是签名 key 的一个小问题,实际上您已经使用自己的 keystore 获取了 map key ,但目前您的应用程序使用默认的 android debug.keystore 进行了签名。使用生成映射 key 的 keystore 对您的应用程序进行签名,然后在模拟器上安装并运行它

关于Android 谷歌地图未显示在模拟器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6758456/

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