谷歌地图V2显示了Android 2.2的黑屏 [英] Google Maps V2 shows blank screen on android 2.2

查看:203
本文介绍了谷歌地图V2显示了Android 2.2的黑屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想下面的 Android地图V2快速入门教程 但是,当我运行应用程序时,会显示一个空白地图画面。我的手机采用了Android 2.2.1。

I tried following a tutorial on Android Maps V2 Quick Start But when I run the app, a blank map screen is shown. My phone uses android 2.2.1.

这是什么样的logcat显示:

This is what shows in 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文件:

This is the manifest.xml file:

<?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>

编辑:我已经添加了我的谷歌API控制台的图像:

I have added an image of my google api console:

推荐答案

我终于发现了什么问题。我选错了调试密钥库中。我正与Ubuntu主机。既然我打开Eclipse作为根,Eclipse中的默认密钥库位于在我的根文件夹(/root/.android/.android/debug.keystore)9:20我创建API密钥从我的用户文件夹中的调试密钥库中。我创建了一个新的API密钥根文件夹中的调试密钥库和它的作品了。

I finally found out what the problem was. I was picking the wrong debug keystore. I am working with an ubuntu machine. Since I opened eclipse as root, the default keystore in eclipse was located in my root folder(/root/.android/.android/debug.keystore) whiles I was creating the api key with the debug keystore from my user folder. I created a new api key with the debug keystore in the root folder and it works now.

这篇关于谷歌地图V2显示了Android 2.2的黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆