谷歌MapActivity不显示地图 [英] Google MapActivity not displaying map

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

问题描述

我试图让谷歌地图的工作。它不显示所述地图。我得到了LogCat中出现以下错误

I am trying to get google maps working. It is not displaying the map. I get the following error in LogCat

Couldn't get connection factory client

我已经通过所有重复的帖子,并进行了如下修改

I have been through all the duplicate posts, and made the following changes


  • 确保使用许可权和使用库都在里面标记

  • 使用debug.keystore,而不是定制

  • 使用我的私钥谷歌地图签约,并更新了与在XML地图键图形页面(这个公共职位,我已经改变了它)

  • 导出我的应用程序,并用debug.keystore构建它

我在模拟器中运行它。在模拟器作品地图。

I am running it on emulator. Maps on emulator works.

Android清单

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <uses-library android:name="com.google.android.maps" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <activity
        android:name=".MyActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".GetLocation" android:label="@string/app_name"/>
</application>

location.xml

location.xml

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="0psLgKtDQLB35-XJXUrjR4bKHIBDRuHu-O-xVhg"
    android:id="@+id/location"
/>

sudo keytool -list -alias androiddebugkey -storepass android -keypass android -keystore     debug.keystore 

返回

androiddebugkey, 20 Mar, 2012, PrivateKeyEntry, 
Certificate fingerprint (MD5): 20:D3:54:D9:F8:70:17:A4:BA:21:5C:98:88:27:45:E0

固定
我把使用许可权应用标签之外
并采用库应用标记中

Fixed I put uses-permission outside of Application tag And uses-library inside of Application tag

推荐答案

使用许可权之外&lt;应用&GT; 标签。和

不能获得连接工厂客户端

Couldn't get connection factory client

和其地图API密钥的问题。而你应该创建清新地图的API密钥。

And its map-api key problem .And you should create Fresh Map-api key .

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

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