android - Google Maps V2 在 android 2.2 上显示黑屏

标签 android google-maps android-maps google-maps-api-2

我尝试按照 Android Maps V2 Quick Start 上的教程进行操作 但是当我运行该应用程序时,会显示一个空白的 map 屏幕。我的手机使用的是 android 2.2.1。

enter image description here

这是 logcat 中显示的内容:

12-07 18:07:52.479: W/dalvikvm(1654): VFY: unable to resolve instance field 24
12-07 18:07:53.129: W/dalvikvm(1654): Unable to resolve superclass of Lmaps/a/du; (411)
12-07 18:07:53.129: W/dalvikvm(1654): Link of class 'Lmaps/a/du;' failed
12-07 18:07:53.139: W/dalvikvm(1654): Unable to resolve superclass of Lmaps/a/ej; (2363)
12-07 18:07:53.139: W/dalvikvm(1654): Link of class 'Lmaps/a/ej;' failed
12-07 18:07:53.139: W/dalvikvm(1654): Unable to resolve superclass of Lmaps/j/k; (2379)
12-07 18:07:53.139: W/dalvikvm(1654): Link of class 'Lmaps/j/k;' failed
12-07 18:07:53.149: E/dalvikvm(1654): Could not find class 'maps.j.k', referenced from method maps.y.ae.a
12-07 18:07:53.149: W/dalvikvm(1654): VFY: unable to resolve new-instance 3571 (Lmaps/j/k;) in Lmaps/y/ae;
12-07 18:07:53.389: W/dalvikvm(1654): VFY: unable to resolve direct method 14965: Ljava/io/IOException;.<init> (Ljava/lang/String;Ljava/lang/Throwable;)V

编辑:这是 manifest.xml 文件:

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

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />
    <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
    <permission android:name="com.eunice.mapstry.permission.MAPS_RECEIVE"
                android:protectionLevel="signature"/>
    <uses-permission android:name="com.eunice.mapstry.permission.MAPS_RECEIVE"/>
    <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" >
        <uses-library android:name="com.google.android.maps" />

        <activity
            android:name="com.eunice.mapstry.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="AIzaSyBt_JE6_XIVR8-t0HrbhskeLrAVxSJst6c"/>
    </application>

</manifest>

编辑:我添加了我的 google api 控制台的图像:

enter image description here

最佳答案

我终于找到问题所在了。我选择了错误的调试 keystore 。我正在使用 ubuntu 机器。由于我以 root 身份打开 eclipse,因此 eclipse 中的默认 keystore 位于我的根文件夹 (/root/.android/.android/debug.keystore) 中,而我正在使用用户文件夹中的调试 keystore 创建 api key 。我在根文件夹中使用调试 keystore 创建了一个新的 api key ,它现在可以使用了。

关于android - Google Maps V2 在 android 2.2 上显示黑屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13768681/

相关文章:

android - bundle 失败 : Error and 404 when running React-Native project

regex - 谷歌地图的地址格式

Android 谷歌地图版本 2 显示空白页面?

android - 带有 Google Map V2 和 SupportMapFragment 的空白 map (不,这不是 API key 问题)

android - react native Android : Manifest merger failed

android - 在 Android 上使用 libGDX 切换屏幕很慢,但在 PC 上是即时的?

java - 有什么方法可以使用 Swift 进行 iOS 和 Android 开发吗?

javascript - 如何避免 InfoWindow 在 Google map 上重叠

javascript - Google map 脚本仅在我第一次打开页面时加载

android - android 中的 GeoPoint 创建