Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 谷歌地图显示为灰色_Android - Fatal编程技术网

Android 谷歌地图显示为灰色

Android 谷歌地图显示为灰色,android,Android,我知道以前有人问过这个问题,但我已经阅读/测试了好几个小时,无法显示我的地图!我生成了md5并注册了它,这给了我在下面代码中使用的密钥。请帮忙!!!!!! 以下是androidmanifest.xml文件: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.libertytech.lo

我知道以前有人问过这个问题,但我已经阅读/测试了好几个小时,无法显示我的地图!我生成了md5并注册了它,这给了我在下面代码中使用的密钥。请帮忙!!!!!! 以下是androidmanifest.xml文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.libertytech.locatemycar"
  android:versionCode="1"
  android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
    <uses-library android:name="com.google.android.maps" />
    <activity android:name=".Home"
              android:label="@string/app_name"
              android:configChanges="orientation|keyboardHidden|keyboard">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="com.libertytech.locatemycar.GoogleMap" android:label="@string/app_name"
              android:theme="@android:style/Theme.NoTitleBar"
              android:configChanges="orientation|keyboardHidden|keyboard">
    </activity>
    <activity android:name="com.libertytech.locatemycar.Test" android:label="@string/app_name"
              >
    </activity>

</application>
<uses-permission android:name="android.permission.Internet"/>
<uses-permission android:name="android.permission.ACCESS_COURSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk android:minSdkVersion="7" />
</manifest> 

这是googlemaps.xml



所有必需的xml标记似乎都位于正确的位置。我在电话上有互联网(我可以浏览网页)。我遗漏了什么?

我将提供一份检查表。请确保正确遵守这些规定

  • 构建使用的目标平台:它应该是谷歌API
  • Emulator:您应该使用目标Google的Emulator,而不是Android
  • MD5密钥:它应该从编译应用程序的同一台机器生成。 另外,请遵循如何获取此链接中详细说明的应用程序的mapview:

  • 要使应用程序在仿真器中工作,可以使用从调试密钥库生成的API密钥

    要在手机上运行应用程序,您需要一个不同的谷歌API密钥;这必须从您已显式签名的私有密钥库生成

    见本链接第1节
    有关详细信息,我需要使用安卓.permission.INTERNET而不是安卓.permission.INTERNET!如果谷歌能给出一个关于权限缺失或有用的错误,那就太好了。这本可以帮我省下好几个小时的工作

    1)我确实设定了构建目标。我已经用7级api检查了“GoogleAPI”,这也是Minsdk版本。如果没有设置,应用程序甚至不会启动。2) 我没有使用模拟器,我使用的是HTC。3) 我正在从编译的同一台机器生成MD5密钥。我还没有将其发布到应用商店。我正在将usb线连接到电脑和手机,并将应用程序部署到手机上。我已经阅读了你提供的链接,我认为这不是问题所在。我使用的是Eclipse,Eclipse默认使用调试键。Eclipse默认使用调试键,但您仍然需要获取Google为该调试键提供的键。没有它,它甚至不会工作,无论你是尝试它只是为了自己。它们是不同的东西,您需要与调试密钥相关联的映射密钥。这是从调试密钥库生成的MD5密钥:CF:ED:24:FA:81:28:CA:EF:E6:8A:A6:23:46:98:46:1F然后我转到google注册页面并使用该页面获取api密钥006_r2vy70willmhcnagizooe7jjymxytxa。这就是上面例子中的关键。你是要求我做一些不同的事情,还是在我已经做的事情之外?
    <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="006_T_R2vy70wILMHcCnAGiZoOe7jVjYM_xYtXA"
    />