I am facing an issue in google map.Google map is not showing when I download the apk from google play store but it works fine when I manually install(by transferring to device) same apk which was uploaded to play store.
I have rechecked my debug and release keys which are present here
Please find permission in manifest file:
<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 Application node:
<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);
}
}