编辑:
我转移了 20 多个尝试使用 Google Maps for Android v2 的项目。更改 key 和内容后,现在可以使用了。我不知道是什么让这项工作成功,但谢谢大家。我有一个 keystore , key 是正确的。我想它以某种方式神奇地修复了。好吧,谢谢大家。
我搜索了 2 天,但无法解决此问题。我做了一切,然而,这个应用程序不能工作。
我希望我的应用程序能够在 Android 2.2 及更高版本上运行。就像它说的那样“如果你在第 8 级创建你的应用程序,它将支持 95% 的市场”。
这是我的截图和源代码:
我正在粘贴最容易获得的源代码。这是我从网上拿来的。
这是命令的输出
keytool -list -keystore <path>
***************** WARNING WARNING WARNING ***************** * The integrity of the information stored in your keystore * * has NOT been verified! In order to verify its integrity, * * you must provide your keystore password. * ***************** WARNING WARNING WARNING *****************
Keystore type: JKS Keystore provider: SUN
Your keystore contains 1 entry
androiddebugkey, 15.Mar.2013, PrivateKeyEntry,
Certificate fingerprint (SHA1): xxx
main.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="AIzaSyDim-x5Gxxx"
/>
list 文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidhive.googlemaps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<!-- Add Google Map Library -->
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".AndroidGoogleMapsActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<!-- Allow to connect with internet -->
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
java文件(不用全贴,不过我觉得最好全贴)
这是我的截图:
http://i.imgur.com/gExHpUG.png
http://i.imgur.com/AMOXKhr.png
http://i.imgur.com/Aqon97Y.png
我正在尝试将此应用程序编译为 Android 4.2.2,但我尝试并希望使其在 2.2 及更高版本中运行。
这是属性窗口的 Android 选项卡,只是为了确保:
http://i.imgur.com/ht0CQwT.png
这是我的日志
03-20 07:01:20.145: W/System.err(956): at java.lang.Thread.run(Thread.java:856)
03-20 07:01:20.665: W/System.err(956): IOException processing: 26
03-20 07:01:20.665: W/System.err(956): java.io.IOException: Server returned: 3
03-20 07:01:20.665: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
03-20 07:01:20.675: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
03-20 07:01:20.675: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
03-20 07:01:20.675: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
03-20 07:01:20.675: W/System.err(956): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
这些行一直在重复。
非常感谢。 您的帖子似乎包含未正确格式化为代码的代码”错误 我删除空行。抱歉弄乱了代码。
最佳答案
http://i.imgur.com/ht0CQwT.png 查看快照。您没有添加显示 Google Android Map V2 所需的 Google Play 服务库。请下载并添加该库,然后重试。
另请参阅目标。您的目标是 4.2.2,您正在 2.2 上访问它。将目标更改为 2.2 并使用支持 fragment 。
谢谢,
关于java - 黑屏 Android 2.2 Google map v2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15516476/