I'm having a problem displaying google maps in my app, before the map was displayed correctly, the marker with the requested approach, when I emulate my project in the emulator or do it on my cell phone through cable, the map is displayed correctly, but now that i uploaded my app to play store, the map is not showing on the devices that download it from there.
I have configured the credential in GoogleApi for several months, now I have generated a new key and added it to the project but it still does not show me the map.
When I requested the first key in GooleAPIs my project had a different package name than the one I have now and I am not sure if this is the reason, I have searched GoogleAPIs for the project configuration to change the project name but I can not find it, also I would like to know if creating a new project in GoogleAPIs could fix this.
Below I show you the java file, the xml and some screenshots of GoogleAPIs, I appreciate your help.
JAVA
public class Fragment_Rutas extends Fragment implements OnMapReadyCallback {
public Fragment_Rutas() {
// Required empty public constructor
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_rutas, container, false);
SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
return v;
//AIzaSyBfIvrguKAhUaW8CA0dvgyEXEFADleNCtc
}
@Override//acercamiento
public void onMapReady(GoogleMap googleMap) {
LatLng bogota = new LatLng(4.653421, -74.145150);
googleMap.addMarker(new MarkerOptions().position(bogota)
.title("Uniagustiniana"));
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(bogota, 16.1f));
}
}
XML
<LinearLayout
android:layout_width="match_parent"
android:layout_height="300dp"
android:background="#94dea7">
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
</LinearLayout>
Image of the activity
Image GoogleAPIs, credentials.
Remember that the Keystore you use for debugging is not the same as the one used to sign an application for production.
Get the SHA-1 of the Keystore with which you signed your app to the Playstore and enable the API in the console for your app bundle, this should work.
The API Key for debug is not the same as the one defined for an application destined for the Play Store.