2011-11-23 100 views
2

我在设备/模拟器上运行Google地图时遇到一些问题。Google地图不支持Android

第一个问题出现,因为我想获得密钥。我制作了自己的指纹,并输入here来获取API密钥。

但后来我得到错误:“您输入的指纹无效。”

使用其他调试键(我发现他们在网上)我总是得到logcat的错误:

I/MapActivity(19787): Handling network change notification:CONNECTED 
E/MapActivity(19787): Couldn't get connection factory client 

回答

2

调试键是每个工作站的“独一无二”。你必须通过执行给到注册网站调试键:

keytool -list -keystore ~/.android/debug.keystore 

然后你地方新密钥的注册网站为您提供了在你MapActivity的.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/map_view" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:clickable="true" 
    android:apiKey="put_here_the_key_that_signup_site_gives_you" 
/> 
+1

感谢您的回答,但它是另一个错误。 我已经安装了Java 1.7并为此keytool生成了SHA1指纹,但对于google maps键,您需要MD5指纹。 因此,我将Java 1.7更改为Java 1.6,然后运行。 – FabianW

+0

作为回答添加,以便帮助其他具有相同问题的人。 – Manos