Android MapView - 未使用Debug API密钥加载磁贴

Roa*_*ers 3 android google-maps

我有一些问题在Android开发中将tile加载到我的MapView中.我在这里搜索并查看了类似的问题但到目前为止没有运气.

我已经查看了这里的说明并掌握了我的调试API密钥.我已将其输入到我的MapView中.

我已经检查过我的模拟器和我的调试设备是否有互联网连接.

我已将我的清单文件中的Internet权限标记移动到应用程序标记之前.

我不知道还有什么要检查.

我也不确定发展这个的最好方法.似乎我无法使用正确签名的应用程序进行调试,因为调试密钥库需要相同的密码 - android.这意味着每次我去发布版本时我都要更改密钥 - 这看起来非常脆弱!

有没有办法用我自己生成的地图API密钥开发和发布构建?

一些代码供您查看:

main.xml中:

<com.google.android.maps.MapView
    android:id="@+id/mapView" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent"
    android:apiKey="??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:??"
    />
Run Code Online (Sandbox Code Playgroud)

AndroidManifest.xml中:

<manifest 
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0" 
package="com.my.package.name"
>

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

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />

<application 
    android:icon="@drawable/icon" 
    android:label="@string/app_name" 
    android:debuggable="true"
    >

    <activity 
        android:name=".MyMainClass" 
        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> 
Run Code Online (Sandbox Code Playgroud)

任何帮助非常感谢.

Com*_*are 11

机器人:apiKey =" - : - : - : - : - : - : - : - : - : - : - : - : - : - : - : ??"

你在那里有冒号的事实表明,也许你误解了你应该粘贴的内容.

冒号位于签名密钥的MD5指纹中.然后,您需要将这些内容粘贴到Google网站上的表单中,然后返回实际的签名密钥,如下所示:

android:apiKey="00yHj0k7_7vzHbUFXzY2j94lYYCqW3NAIW8EEEw"
Run Code Online (Sandbox Code Playgroud)