firebase / geofire-java

GeoFire for Java - Realtime location queries with Firebase
MIT License
670 stars 271 forks source link

PID: 5980 java.lang.NoSuchMethodError: No virtual method setValue(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/firebase/tasks/Task; in class Lcom/google/firebase/database/DatabaseReference; or its super classes (declaration of 'com.google.firebase.database.DatabaseReference' appears in /data/app/com.habeeb.tracker-1/base.apk) at com.firebase.geofire.GeoFire.setLocation(GeoFire.java:182) at com.firebase.geofire.GeoFire.setLocation(GeoFire.java:154) #135

Closed habeebrahmanpt closed 6 years ago

habeebrahmanpt commented 6 years ago

PID: 5980 java.lang.NoSuchMethodError: No virtual method setValue(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/firebase/tasks/Task; in class Lcom/google/firebase/database/DatabaseReference; or its super classes (declaration of 'com.google.firebase.database.DatabaseReference' appears in /data/app/com.habeeb.tracker-1/base.apk) at com.firebase.geofire.GeoFire.setLocation(GeoFire.java:182) at com.firebase.geofire.GeoFire.setLocation(GeoFire.java:154)

but its working in com.firebase:geofire-android: 2.1.1

samtstern commented 6 years ago

This looks like a duplicate of #133

habeebrahmanpt commented 6 years ago

not working in compile 'com.firebase:geofire-android:2.3.1'

but its working in com.firebase:geofire-android: 2.1.1

emailsubjekt commented 5 years ago

When is this going to be solved?

rachna1812 commented 5 years ago

java.lang.NoSuchMethodError: No virtual method setValue(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/firebase/tasks/Task; in class Lcom/google/firebase/database/DatabaseReference; or its super classes (declaration of 'com.google.firebase.database.DatabaseReference' appears in /data/app/com.example.asap-2/split_lib_dependencies_apk.apk) at com.firebase.geofire.GeoFire.setLocation(GeoFire.java:182) at com.firebase.geofire.GeoFire.setLocation(GeoFire.java:154) at com.example.asap.DriverMapActivity.onLocationChanged(DriverMapActivity.java:84) at com.google.android.gms.internal.location.zzay.notifyListener(Unknown Source) at com.google.android.gms.common.api.internal.ListenerHolder.notifyListenerInternal(Unknown Source) at com.google.android.gms.common.api.internal.ListenerHolder$zaa.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:102) at com.google.android.gms.internal.base.zap.dispatchMessage(Unknown Source)

thank you @habeebrahmanpt your answer helped me in this case.

NiwanthaR commented 4 years ago

Read this - https://github.com/firebase/geofire-java Its support - implementation 'com.firebase:geofire-java:3.0.0' (vertion)

//----------------------------------------code-------------------------------------------

    firebaseAuth = FirebaseAuth.getInstance();
    firebaseDatabase = FirebaseDatabase.getInstance();
    firebaseUser = firebaseAuth.getCurrentUser();

    String userid = firebaseUser.getUid();
    DatabaseReference ref = firebaseDatabase.getReference("Active Users");
    GeoFire geoFire = new GeoFire(ref);

    geoFire.setLocation(userid, new GeoLocation(location.getLatitude(), location.getLongitude()), new GeoFire.CompletionListener() {
        @Override
        public void onComplete(String key, DatabaseError error) {
            if (error!=null)
            {
                Toast.makeText(client_dashboard.this,"Can't go Active",Toast.LENGTH_SHORT).show();
            }
            Toast.makeText(client_dashboard.this,"You are Active",Toast.LENGTH_SHORT).show();
        }
    });