G
G
gochag2017-09-22 19:04:27
Android
gochag, 2017-09-22 19:04:27

Google map not showing after publishing app. How to decide?

Hello, I've been suffering for a week now and I can not solve the problem. I wrote an application that receives the coordinates of buses in real time and puts (markers) on the map their location.
Used the standard Google Map Activity layout. The studio automatically creates the *google_map_api.xml* file in the *src/release/values/* and *src/debug/values/* folders.
I created the .jks file according to the instructions and got my sha-1 key F7:19 :A0:25:6D:A2:AA:9D.... . (keytool utility)
I created a project in GoogleAPIs Console and got two keys with my own SHA-1 (F7:19:A0:25:6D:A2:AA:9D...) and automatically generated SHA-1 for debugging.
I added the received keys to the xml file, launched the application, the program worked, but when I publish the application (Google Play), the map is not displayed.
Release and debug key both work in debug mode Debug
key google map api

To get one, follow this link, follow the directions and press "Create" at the end:

https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=F7:19:A0:25:6D:A2:AA%3Bcom.gochag.comand.neqliyyat

You can also add your credentials to an existing key, using these values:

Package name:
39:5F:45:EC:40:2B:0B

SHA-1 certificate fingerprint:
39:5F:45:EC:40:2B:0B
F7:19:A0:25:6D:A2:AA
Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key

Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.


Release
AIzaSyAoE7JLM

Debug
AIzaSyB2jp1oj
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyB2jp1oj</string>

Release key google map api
To do this, you can either add your release key credentials to your existing
key, or create a new key.

Note that this file specifies the API key for the release build target.
If you have previously set up a key for the debug target with the debug signing certificate,
you will also need to set up a key for your release certificate.

Follow the directions here:

https://developers.google.com/maps/documentation/android/signup

Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyAoE7JL</string>

Manifesto
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.gochag.comand.neqliyyat">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <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=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Avtobus.Bus_Route" />
        <activity android:name=".Avtobus.EtrafliAxtar" />

        <!--
             The API key for Google Maps-based APIs is defined as a string resource.
             (See the file "res/values/google_maps_api.xml").
             Note that the API key is linked to the encryption key used to sign the APK.
             You need a different API key for each encryption key, including the release key that is used to
             sign the APK for publishing.
             You can define the keys for the debug and release targets in src/debug/ and src/release/.
        -->

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />


        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />


    </application>

</manifest>

Buildgredl
apply plugin: 'com.android.application'
android {
    signingConfigs {
    }
    compileSdkVersion 24
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.gochag.comand.neqliyyat"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 20
        versionName "v.1.0s"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {c
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:design:25.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.google.android.gms:play-services-maps:10.0.1'
    testCompile 'junit:junit:4.12'
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mr_serg77, 2017-09-22
@mr_serg77

Recently there was a question here on this topic. The salt there seemed to be in hashes (the person indicated the hash of the dubagg version, instead of the release one).
And in general, update the version of GAPS to the latest.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question