【问题标题】:Android google map not loaded after inserting API key插入 API 密钥后未加载 Android 谷歌地图
【发布时间】:2012-01-25 12:34:59
【问题描述】:

我正在尝试在 mapview 中加载谷歌地图。我在 main.xml 中插入了 google API 密钥。

这是我的清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="My.google.mao"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" />

<uses-sdk android:minSdkVersion="7" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".GmapActivity"
        android:theme="@android:style/Theme.NoTitleBar"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <uses-library android:name="com.google.android.maps" />
</application>

</manifest>

这是 main.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/mapview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="Api key"/>

//Api key has been inserted

mapview 中只加载了盒子,谁能解决我的问题?

【问题讨论】:

    标签: android xml android-widget


    【解决方案1】:

    最可能的原因是混淆了调试密钥和发布密钥,因为签名不同,密钥也不同,您需要同时获得两者。 programaticaly selecting the right key有帖子

    【讨论】:

    • 这可能是可能的,但我该如何解决我的问题,有人会帮助我吗?
    【解决方案2】:

    这个问题有两种情况 授予这些使用权限也可以访问核心位置,访问精细位置

    还有一件事是您没有获得正确的 API 密钥,因此请再次正确生成,

    该 api 密钥仅在您的系统中有效

    如果您在生成 api 密钥时遇到任何问题,我会帮助您

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-30
      • 2013-01-06
      • 1970-01-01
      相关资源
      最近更新 更多