EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 444 forks source link

Firestore References can't be parsed #577

Closed RaphaelJenni closed 6 years ago

RaphaelJenni commented 6 years ago

The firestore supports references to be stored. This doesn't work with the plugin. You can't set a reference through the app and if you try to receive a reference, the app crashes.

Crash report:

System.err: com.tns.NativeScriptException: 
System.err: Calling js method run failed
System.err: 
System.err: Error: java.lang.AssertionError: java.lang.NoSuchFieldException: ASCENDING
System.err:     com.google.gson.internal.bind.TypeAdapters$EnumTypeAdapter.<init>(TypeAdapters.java:791)
System.err:     com.google.gson.internal.bind.TypeAdapters$30.create(TypeAdapters.java:817)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.MapTypeAdapterFactory.create(MapTypeAdapterFactory.java:126)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:56)
System.err:     com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:208)
System.err:     com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:145)
System.err:     com.google.gson.Gson.toJson(Gson.java:669)
System.err:     com.google.gson.Gson.toJson(Gson.java:648)
System.err:     com.google.gson.Gson.toJson(Gson.java:603)
System.err:     com.google.gson.Gson.toJson(Gson.java:583)
System.err:     com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err:     com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err:     com.tns.gen.com.google.android.gms.tasks.OnCompleteListener.onComplete(OnCompleteListener.java:11)
System.err:     com.google.android.gms.tasks.zzf.run(Unknown Source)
System.err:     android.os.Handler.handleCallback(Handler.java:751)
System.err:     android.os.Handler.dispatchMessage(Handler.java:95)
System.err:     android.os.Looper.loop(Looper.java:154)
System.err:     android.app.ActivityThread.main(ActivityThread.java:6119)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
System.err: Caused by: java.lang.NoSuchFieldException: ASCENDING
System.err:     java.lang.Class.getField(Class.java:1549)
System.err:     com.google.gson.internal.bind.TypeAdapters$EnumTypeAdapter.<init>(TypeAdapters.java:780)
System.err:     com.google.gson.internal.bind.TypeAdapters$30.create(TypeAdapters.java:817)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.MapTypeAdapterFactory.create(MapTypeAdapterFactory.java:126)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:56)
System.err:     com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:208)
System.err:     com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:145)
System.err:     com.google.gson.Gson.toJson(Gson.java:669)
System.err:     com.google.gson.Gson.toJson(Gson.java:648)
System.err:     com.google.gson.Gson.toJson(Gson.java:603)
System.err:     com.google.gson.Gson.toJson(Gson.java:583)
System.err:     com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err:     com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err:     com.tns.gen.com.google.android.gms.tasks.OnCompleteListener.onComplete(OnCompleteListener.java:11)
System.err:     com.google.android.gms.tasks.zzf.run(Unknown Source)
System.err:     android.os.Handler.handleCallback(Handler.java:751)
System.err:     android.os.Handler.dispatchMessage(Handler.java:95)
System.err:     android.os.Looper.loop(Looper.java:154)
System.err:     android.app.ActivityThread.main(ActivityThread.java:6119)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
System.err: File: "file:///data/data/com.app.appCode/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js, line: 142, column: 24
System.err: 
System.err: StackTrace: 
System.err:     Frame: function:'firebase_common_1.firebase.toJsObject', file:'file:///data/data/com.app.appCode/files/app/tns_modules/nativescript-plugin-firebase/firebase.js', line: 135, column: 34
System.err:     Frame: function:'', file:'file:///data/data/com.app.appCode/files/app/tns_modules/nativescript-plugin-firebase/firebase.js', line: 2173, column: 179
System.err:     Frame: function:'', file:'file:///data/data/com.app.appCode/files/app/shared/services/user-data.service.js', line: 52, column: 41
System.err:     Frame: function:'SafeSubscriber.__tryOrSetError', file:'file:///data/data/com.app.appCode/files/app/tns_modules/rxjs/Subscriber.js', line: 247, column: 16
System.err:     Frame: function:'SafeSubscriber.next', file:'file:///data/data/com.app.appCode/files/app/tns_modules/rxjs/Subscriber.js', line: 187, column: 27
System.err:     Frame: function:'Subscriber._next', file:'file:///data/data/com.app.appCode/files/app/tns_modules/rxjs/Subscriber.js', line: 125, column: 26
System.err:     Frame: function:'Subscriber.next', file:'file:///data/data/com.app.appCode/files/app/tns_modules/rxjs/Subscriber.js', line: 89, column: 18
System.err:     Frame: function:'DoSubscriber._next', file:'file:///data/data/com.app.appCode/files/app/tns_modules/rxjs/operator/do.js', line: 83, column: 24
System.err:     Frame: function:'Subscriber.next', file:'file:///data/data/com.app.appCode/files/app/tns_modules/rxjs/Subscriber.js', line: 89, column: 18
System.err:     Frame: function:'', file:'file:///data/data/com.app.appCode/files/app/tns_modules/rxjs/observable/PromiseObservable.js', line: 66, column: 36
System.err:     Frame: function:'ZoneDelegate.invoke', file:'file:///data/data/com.app.appCode/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 365, column: 26
System.err:     Frame: function:'Zone.run', file:'file:///data/data/com.app.appCode/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 125, column: 43
System.err:     Frame: function:'', file:'file:///data/data/com.app.appCode/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 760, column: 57
System.err:     Frame: function:'ZoneDelegate.invokeTask', file:'file:///data/data/com.app.appCode/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 398, column: 31
System.err:     Frame: function:'Zone.runTask', file:'file:///data/data/com.app.appCode/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 165, column: 47
System.err:     Frame: function:'drainMicroTaskQueue', file:'file:///data/data/com.app.appCode/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 593, column: 35
System.err: 
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err:     at com.tns.gen.java.lang.Runnable.run(Runnable.java:10)
System.err:     at android.os.Handler.handleCallback(Handler.java:751)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
System.err:     at android.os.Looper.loop(Looper.java:154)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:6119)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
System.err: Caused by: java.lang.AssertionError: java.lang.NoSuchFieldException: ASCENDING
System.err:     at com.google.gson.internal.bind.TypeAdapters$EnumTypeAdapter.<init>(TypeAdapters.java:791)
System.err:     at com.google.gson.internal.bind.TypeAdapters$30.create(TypeAdapters.java:817)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.MapTypeAdapterFactory.create(MapTypeAdapterFactory.java:126)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
System.err:     at com.google.gson.Gson.getAdapter(Gson.java:423)
System.err:     at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:56)
System.err:     at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:208)
System.err:     at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.write(MapTypeAdapterFactory.java:145)
System.err:     at com.google.gson.Gson.toJson(Gson.java:669)
System.err:     at com.google.gson.Gson.toJson(Gson.java:648)
System.err:     at com.google.gson.Gson.toJson(Gson.java:603)
System.err:     at com.google.gson.Gson.toJson(Gson.java:583)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err:     at com.tns.gen.com.google.android.gms.tasks.OnCompleteListener.onComplete(OnCompleteListener.java:11)
System.err:     at com.google.android.gms.tasks.zzf.run(Unknown Source)
System.err:     ... 7 more
System.err: Caused by: java.lang.NoSuchFieldException: ASCENDING
System.err:     at java.lang.Class.getField(Class.java:1549)
System.err:     at com.google.gson.internal.bind.TypeAdapters$EnumTypeAdapter.<init>(TypeAdapters.java:780)
System.err:     ... 60 more

Reference in the firebase console: image

If I store the reference it just converts the reference to an json object

// reference get
{
    id: THE_UID_OF_THE_ELEMENT
}
EddyVerbruggen commented 6 years ago

How did you store that reference?

RaphaelJenni commented 6 years ago

Through a web app.

EddyVerbruggen commented 6 years ago

I'm looking for iOS and Android examples for adding/retrieving references in the Firestore docs but no luck so far: https://firebase.google.com/docs/firestore/manage-data/add-data

EddyVerbruggen commented 6 years ago

Oh hang on, is the datatype of your favoriteStation path/reference simply a string? Hmm, I guess not as it should have " quotes around the value..

Ah, found a way to add a reference to the DB through the Firebase web UI. You can select the 'reference' type from the list of types, but I didn't see it before because it was only revealed after scrolling in the list..

RaphaelJenni commented 6 years ago

No, it is a reference.

EddyVerbruggen commented 6 years ago

Yeah, see the updated comment ;)

EddyVerbruggen commented 6 years ago

With 5.1.3 references will be retrieved from Firestore (as well as the other new data type: Geopoint). But you won't be able to save those just yet.

Here's a demo on how to use such a reference in your app.

At least your app will no longer crash on Android when those types are encountered.

jkod commented 6 years ago

@EddyVerbruggen is support for writing references something that is planned for the near future?

manojdcoder commented 6 years ago

@EddyVerbruggen Setting the native reference object writes the reference to fire store as expected (tested on iOS, should work on Android too).

doc.set({
refFieldName: firestore.collection(refColName).doc(refId)[platform.device.os.toLowerCase()]
})

Incase if there is a better solution, kindly suggest.

Ot92 commented 6 years ago

@manojdcoder, it does not work on Android. As you see below what should be references (organization & process) are objects screenshot from 2018-08-26 20-34-42

Im using nativescript-plugin-firebase v6.4.1

EddyVerbruggen commented 6 years ago

Adding support for saving references in #875.

EddyVerbruggen commented 6 years ago

Btw, @manojdcoder was right: it was possible that way on iOS, but not on Android.