Runtime Error, Attempt To invoke Virtual Method

Attempt to invoke virtual method ‘com.google.android.gms.maps.model.Marker
com.google.android.gms.maps.GoogleMap.addMarker(com.google.android.gms.maps.model.MarkerOptios)’ on a null object reference
The above error is being shown in the app, Please help me out

Post your blocks.

Check my blocks above

I think you are trying to set a marker while your location isn’t found yet in your initialize block.

how to fix it?
the location which is updated on Firebase is 0,0

Wait until you have your location before you put anything in your firebase. If you get a location changed event the location is found not before.

Ok, I am going to edit it, and test it manually…

Thank you For Support
:slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.