Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set new location #14

Open
zoro238 opened this issue Feb 17, 2019 · 8 comments
Open

Cannot set new location #14

zoro238 opened this issue Feb 17, 2019 · 8 comments
Labels
duplicate This issue or pull request already exists

Comments

@zoro238
Copy link

zoro238 commented Feb 17, 2019

When you execute the command to write to Firestore the application collapses.
Note that firebase works perfectly.

geoFirestore.setLocation("k", new GeoPoint(37.7853889, -122.4056973), new GeoFirestore.CompletionListener() {
      @Override
      public void onComplete(Exception e) {
         Log.v("geo","complete"+e);
         // ...
      }
});

Error

02-17 23:36:48.918 31465-31465/com.2.cvcvbb E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.2.cvcvbb, PID: 31465
    java.lang.NoSuchMethodError: No virtual method set(Ljava/util/Map;Lcom/google/firebase/firestore/SetOptions;)Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/firestore/DocumentReference; or its super classes (declaration of 'com.google.firebase.firestore.DocumentReference' appears in /data/app/com.2.cvcvbb-2/base.apk:classes2.dex)
        at org.imperiumlabs.geofirestore.GeoFirestore.setLocation(GeoFirestore.java:128)
        at com.2.cvcvbb.MapsActivity.DisplayLocation(MapsActivity.java:195)
        at com.2.cvcvbb.MapsActivity.onConnected(MapsActivity.java:407)
        at com.google.android.gms.common.internal.GmsClientEventManager.onConnectionSuccess(Unknown Source)
        at com.google.android.gms.common.api.internal.zaaw.zab(Unknown Source)
        at com.google.android.gms.common.api.internal.zaak.zaaq(Unknown Source)
@zoro238 zoro238 changed the title not rite in firestore not write in firestore Feb 17, 2019
@mirdones
Copy link

its is the same issue as #13

@zoro238
Copy link
Author

zoro238 commented Feb 19, 2019

yes but i am used 18.0.1 and same probem

i search slove my problem

@morcelicaio
Copy link

I have the same problem.

zoro238, did you solve this mistake?

@Supercaly Supercaly added the duplicate This issue or pull request already exists label Jun 5, 2019
@zoro238
Copy link
Author

zoro238 commented Jul 2, 2019

I have the same problem.

zoro238, did you solve this mistake?

no

@Supercaly Supercaly reopened this Jul 3, 2019
@Supercaly
Copy link
Collaborator

@zoro238 what version of GeoFirestore are you using, try the last 1.5.0 and let us know if it solves the problem

@Supercaly Supercaly changed the title not write in firestore Cannot set new location Jul 4, 2019
@BikramKhanikar
Copy link

it only works this way

geoFirestore.setLocation("k", new GeoPoint(37.7853889, -122.4056973), new GeoFirestore.CompletionListener());

This will work, but no efficient. It will stop the app from crashing. But it will not set the location directly from your app, you will have to set the collection & document name manually and then run your to setLocation & you will get the co-ordinates in your database.

@egesamichael
Copy link

I use it this way CollectionReference mDocRef = FirebaseFirestore.getInstance().collection("mycollection"); GeoFirestore geofire = new GeoFirestore(mDocRef); geofire.setLocation("mystring", new GeoPoint(mLastLocation.getLatitude(), mLastLocation.getLongitude())); am listening to the oncomplete listener but that works well for me.

@BikramKhanikar
Copy link

I use it this way CollectionReference mDocRef = FirebaseFirestore.getInstance().collection("mycollection"); GeoFirestore geofire = new GeoFirestore(mDocRef); geofire.setLocation("mystring", new GeoPoint(mLastLocation.getLatitude(), mLastLocation.getLongitude())); am listening to the oncomplete listener but that works well for me.

Thanks Egesa its working fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

6 participants