Dostaję jakieś raporty z powrotem z doświadczenia użytkownika poprzez crashlytics dając mi błądGoogle Maps CameraUpdateFactory nie zainicjowany
Fatal Exception java.lang.NullPointerException
CameraUpdateFactory is not initialized
To nie jest regularny katastrofy, jak w nim nie występuje dla każdego użytkownika, ale to staje się zbyt regularny i muszę go rozwiązać.
Czytałem, że to może się zdarzyć, jeśli mapy nie został zainicjowany, które myślę, że pokryte
if(googleMap!=null){
googleMap.animateCamera(CameraUpdateFactory.newLatLng(selectedLatLng));
}
też prawdopodobnie przyczyną może być to, że usługi Google Play nie jest na urządzeniu lub jest nieaktualny i dodałem do tego również weryfikację.
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(FuelsFragment.this.getActivity());
// Showing status
//CAMERAUPDATE FACTORY CRASH CAN BE A RESULT OF GOOGLE PLAY SERVICES NOT INSTALLED OR OUT OF DATE
//ADDITIONAL VERIFICATION ADDED TO PREVENT FURTHER CRASHES
//https://github.com/imhotep/MapKit/pull/17
if(status == ConnectionResult.SUCCESS)
{
mMapFragment = ReepMapFragment.newInstance();
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
fragmentTransaction.add(R.id.mapContainer, mMapFragment);
fragmentTransaction.commit();
}
else if(status == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED){
reep.toastNotify("You need to update Google Play Services in order to view maps");
}
else if (status==ConnectionResult.SERVICE_MISSING){
reep.toastNotify("Google Play service is not enabled on this device.");
}
Po tym nie jestem pewien, co dalej, ponieważ tak się nie stanie dla każdego użytkownika.
Jeśli ktoś ma jakieś przemyślenia na temat dlaczego tak się dzieje, że doceniam Twój wkład
ja omówiliśmy już w moje pytanie ... –