Google map not showing when the application is downloaded from the PlayStore, but displayed fine when directly signed apk is installed

I am facing a problem on google map. The Google map does not appear when I download the apk from the Google Play Store, but it works fine when I manually install (by transferring it to the device) the same apk that was downloaded for playback in the store.

I double-checked my debug and release keys, which are here

In the manifest file, find the resolution:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

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

And in the node application:

    <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" />

and my java file says:

@Override
public void onMapReady(GoogleMap googleMap) {

    try {

        map = googleMap;
        // it will hide navigation and gps pointer buttons on map
        map.getUiSettings().setMapToolbarEnabled(false);
        //            map.getUiSettings().setZoomControlsEnabled(false);

        if (TextUtils.isEmpty(companyDetailModel.getSupplierCompanyDetailsRS().getResponseDetail().getCompanyDetail().getLatitude())) {


            if (!PermissionUtil.checkPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION)) {

                PermissionUtil.requestPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION, LOCATION_PERMISSION_CODE);

            } else {
                map.setMyLocationEnabled(true);

                GoogleMap.OnMyLocationChangeListener myLocationChangeListener = new GoogleMap.OnMyLocationChangeListener() {
                    @Override
                    public void onMyLocationChange(Location location) {
                        LatLng loc = new LatLng(location.getLatitude(), location.getLongitude());
                        map.animateCamera(CameraUpdateFactory.newLatLngZoom(loc, 16.0f));
                    }
                };
                map.setOnMyLocationChangeListener(myLocationChangeListener);

            }


        } else {

            LatLng latLng = new LatLng(Double.parseDouble(companyDetailModel.getSupplierCompanyDetailsRS().getResponseDetail().getCompanyDetail().getLatitude()), Double.parseDouble(companyDetailModel.getSupplierCompanyDetailsRS().getResponseDetail().getCompanyDetail().getLongitude()));
            map.addMarker(new MarkerOptions().position(latLng)/*.title("" + companyDetailModel.getSupplierCompanyDetailsRS().getResponseDetail().getCompanyDetail().getAddress())/*.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_launcher))*/);
            map.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 14.0f));
        }


        map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
            @Override
            public void onMapClick(LatLng latLng) {
                showFullScreenMap();
            }
        });

    } catch (Exception e) {
        Log.i("LatLng exception", "" + e);
        Utils.showToast(getActivity(), "" + e);
    }

}
+6
source share
3 answers

APK Google Play, Play Console. .

, SHA-1. APK SHA-1, , APK, .

Play Console, APK SHA-1 APK, , Google Play . Google Play:

Google Play App: . Google . , Google , .

.

: APK , SHA-1 1- SHA-1 Google SHA-1 - .

, Google SHA-1 , API Google.

+14

" " , Google ADDED App Signing Google Play. - Keystore/ , /.

, Google Play, apk Google Developer, Google-Play. Self istead Development/Release Keystore . .

. , APK . APK. , Google.

. , . , APK ​​Play Console.

, , Google SHA-1 Google App . SHA-1.

SHA-1 .

Google Play > > > .

+4

SHA1. Google SHA1, release. PlayStore.

. Android SDK , . , . , . " " Android.

:. Android SDK , . keytool. , .

. API SHA- 1

0
source

All Articles