I am setting up GeoFire for my Android app. At the start of retrieving data from the Firebase database, I am getting the following exception.
There was an error getting the GeoFire location: DatabaseError: User code called from the Firebase Database runloop threw an exception: W/System.err: java.lang.Throwable: GeoFire data has invalid format: {lon=74.529964, lat=31.4479225}
Apparently, it is retrieving data from the database but still throwing an exception :(
I have used the following code to retrieve data:
geoFire.getLocation("test1", new LocationCallback() {
@Override
public void onLocationResult(String key, GeoLocation location) {
if (location != null) {
System.out.println(String.format("The location for key %s is [%f,%f]", key, location.latitude, location.longitude));
} else {
System.out.println(String.format("There is no location for key %s in GeoFire", key));
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
System.err.println("There was an error getting the GeoFire location: " + databaseError);
}
});
As I'm new to firebase, is there anything obvious I am missing?This is how my firebase database looks like