Android地图未在已部署的应用

时间:2016-01-12 13:04:53

标签: android google-maps android-manifest

请帮助 - 我已经按照我能找到的所有说明进行了操作,希望准确无误,但是我部署的应用程序没有显示任何地图,只有灰色背景(但是仿真器和具有调试生成密钥的设备)。这是我接管和更新的其他人的应用程序,并有他们的发布密钥库,别名和密码。

使用版本密钥库SHA1编号我在Get API key页面后面使用其版本证书选项卡说明创建了一个新的API版本密钥。我已将此密钥添加到google_maps_api.xml。

我已经添加了我认为我需要的所有必要权限(下面显示)但没有快乐。该应用程序的其余部分工作正常,因此我知道发布密钥库是有效的,因为Google Play允许我部署我的更新。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.HurryHereNow.HHN">

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

<permission
    android:name="com.HurryHereNow.HHN.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<uses-permission android:name="com.HurryHereNow.HHN.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name="com.HurryHereNow.HHN.Splash"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        android:windowSoftInputMode="adjustPan|stateHidden">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.HurryHereNow.HHN.MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustPan|stateHidden">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.HurryHereNow.HHN.Search"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        android:windowSoftInputMode="adjustPan|stateHidden">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="@string/google_maps_key" />
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

</application>

</manifest>

任何人都可以告诉我正在做什么或做了什么,错了吗?我重复一遍,在仿真器和设备上使用debug api key都可以正常工作。

提前致谢...

编辑:包含build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'

defaultConfig {
    applicationId "com.HurryHereNow.HHN"
    minSdkVersion 16
    targetSdkVersion 23
    // This needs updating every release deployment
    versionCode 3
    // This needs updating every release deployment
    versionName "2.3"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
useLibrary 'org.apache.http.legacy'
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
//compile 'com.google.android.gms:play-services-appindexing:8.4.0'
}

1 个答案:

答案 0 :(得分:1)

这可能很烦人,但这些是我在使用我的应用调试Google API问题时采取的一般步骤:

  1. 在运行已部署的应用时检查logcat。如果密钥不匹配或其他阻止访问API的问题,Google地图库非常适合通知您。

  2. 检查您的Google Developers Console并交叉引用密钥签名以及包名称。它们都必须与您发布的应用匹配。您可能需要添加更多条目。

  3. 检查您的清单中是否有正确的密钥和/或可能相互覆盖的任何其他迷路google maps v2密钥。

相关问题