Comments (5)
Hi,
I've tried a few things and couldn't reproduce the crash. I'm not sure I understand your question though, so could you instead please post an example that reproduces the crash?
If that's not possible please post the stacktrace from the Android log.
from nativescript-plugin-firebase.
Sorry to confuse you, here's quick snippet for the error :
// creating the listener for value event and child event
listener1 = new com.firebase.client.ValueEventListener({...
listener2 = new com.firebase.client.ChildEventListener({ ...
// Trying to remove
_ref.removeEventListener(listener1);
_ref.removeEventListener(listener2); // this will crash
What happened was @ the 2nd removeEventListener, it will crash, if just 1 removeEventListener even if I called add listener and then removelistener it just fine, and If I change the remove sequence to
_ref.removeEventListener(listener2);
_ref.removeEventListener(listener1); // this will crash
it will crash and always the 2nd one
Hope it is clear, and sorry to bother you :)
from nativescript-plugin-firebase.
I've tried this as well and indeed the second one always crashes the app. It doesn't even matter which one you invoke first.
I think it's an issue in NativeScript rather than this plugin or the Firebase SDK. Not sure though. I guess we found a case where NativeScript invokes the incorrect overloaded native function as this is the javadoc for the two remove functions and I'm guessing NativeScript somehow caches the method signature and tries to invoke the incorrect method upon the second invocation.
Undelining this assumption is the fact that if you repeatedly invoke the same addListener removeListener function repeatedly there is no issue. Once you invoke the removeListener function for the other type (child or event) the app will crash.
Smells to me we'de better open an issue at the NativeScript repo.
Stacktrace here (doesn't help though):
JS: firebase.init done
JS: firebase.addChildEventListener added: com.tns.gen.com.firebase.client.ChildEventListener_ftns_modules_nativescript-plugin-firebase_firebase_l104_c22__@7e87b10
JS: Removing at path /users: com.tns.gen.com.firebase.client.ChildEventListener_ftns_modules_nativescript-plugin-firebase_firebase_l104_c22__@7e87b10
JS: firebase.addChildEventListener added: com.tns.gen.com.firebase.client.ChildEventListener_ftns_modules_nativescript-plugin-firebase_firebase_l104_c22__@f92ea2f
JS: Removing at path /users: com.tns.gen.com.firebase.client.ChildEventListener_ftns_modules_nativescript-plugin-firebase_firebase_l104_c22__@f92ea2f
JS: firebase.addChildEventListener added: com.tns.gen.com.firebase.client.ChildEventListener_ftns_modules_nativescript-plugin-firebase_firebase_l104_c22__@6d13f1a
JS: Removing at path /users: com.tns.gen.com.firebase.client.ChildEventListener_ftns_modules_nativescript-plugin-firebase_firebase_l104_c22__@6d13f1a
JS: firebase.addValueEventListener added: com.tns.gen.com.firebase.client.ValueEventListener_ftns_modules_nativescript-plugin-firebase_firebase_l130_c22__@2fedd41
JS: Removing at path /companies: com.tns.gen.com.firebase.client.ValueEventListener_ftns_modules_nativescript-plugin-firebase_firebase_l130_c22__@2fedd41
12-09 14:40:13.235 1676 1676 F art : art/runtime/java_vm_ext.cc:410] from java.lang.Object com.tns.Platform.callJSMethodNative(int, java.lang.String, int, boolean, java.lang.Object[])
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] native: #27 pc 00323e2d /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (v8::internal::Execution::TryCall(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::MaybeHandle<v8::internal::Object>*)+173)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] native: #32 pc 00235c1a /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (tns::NativeScriptRuntime::CallJSMethod(_JNIEnv*, v8::Local<v8::Object> const&, std::string const&, _jobjectArray*, v8::TryCatch&)+522)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] native: #33 pc 0022e6b5 /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (Java_com_tns_Platform_callJSMethodNative+357)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] native: #34 pc 00308eda /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethodNative(int, java.lang.String, int, boolean, java.lang.Object[])+190)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] native: #35 pc 0030a084 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[])+440)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] native: #36 pc 00308a41 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[])+1493)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] native: #37 pc 00308c2a /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[])+158)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] native: #38 pc 00308cc6 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[])+90)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] at com.tns.Platform.callJSMethodNative(Native method)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] at com.tns.Platform.dispatchCallJSMethodNative(Platform.java:821)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] at com.tns.Platform.callJSMethod(Platform.java:708)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] at com.tns.Platform.callJSMethod(Platform.java:687)
12-09 14:40:13.236 1676 1676 F art : art/runtime/java_vm_ext.cc:410] at com.tns.Platform.callJSMethod(Platform.java:677)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #29 pc 00323e2d /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (v8::internal::Execution::TryCall(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::MaybeHandle<v8::internal::Object>*)+173)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #34 pc 00235c1a /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (tns::NativeScriptRuntime::CallJSMethod(_JNIEnv*, v8::Local<v8::Object> const&, std::string const&, _jobjectArray*, v8::TryCatch&)+522)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #35 pc 0022e6b5 /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (Java_com_tns_Platform_callJSMethodNative+357)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #36 pc 00308eda /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethodNative(int, java.lang.String, int, boolean, java.lang.Object[])+190)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #37 pc 0030a084 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[])+440)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #38 pc 00308a41 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[])+1493)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #39 pc 00308c2a /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[])+158)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #40 pc 00308cc6 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[])+90)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.callJSMethodNative(Native method)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.dispatchCallJSMethodNative(Platform.java:821)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.callJSMethod(Platform.java:708)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.callJSMethod(Platform.java:687)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.callJSMethod(Platform.java:677)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #32 pc 00323e2d /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (v8::internal::Execution::TryCall(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::MaybeHandle<v8::internal::Object>*)+173)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #37 pc 00235c1a /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (tns::NativeScriptRuntime::CallJSMethod(_JNIEnv*, v8::Local<v8::Object> const&, std::string const&, _jobjectArray*, v8::TryCatch&)+522)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #38 pc 0022e6b5 /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (Java_com_tns_Platform_callJSMethodNative+357)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #39 pc 00308eda /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethodNative(int, java.lang.String, int, boolean, java.lang.Object[])+190)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #40 pc 0030a084 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[])+440)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #41 pc 00308a41 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[])+1493)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #42 pc 00308c2a /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[])+158)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] native: #43 pc 00308cc6 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[])+90)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.callJSMethodNative(Native method)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.dispatchCallJSMethodNative(Platform.java:821)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.callJSMethod(Platform.java:708)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.callJSMethod(Platform.java:687)
12-09 14:40:13.289 1676 1676 F art : art/runtime/runtime.cc:366] at com.tns.Platform.callJSMethod(Platform.java:677)
12-09 14:40:13.401 104 104 F DEBUG : #31 pc 00323e2d /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (v8::internal::Execution::TryCall(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::MaybeHandle<v8::internal::Object>*)+173)
12-09 14:40:13.401 104 104 F DEBUG : #36 pc 00235c1a /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (tns::NativeScriptRuntime::CallJSMethod(_JNIEnv*, v8::Local<v8::Object> const&, std::string const&, _jobjectArray*, v8::TryCatch&)+522)
12-09 14:40:13.401 104 104 F DEBUG : #37 pc 0022e6b5 /data/app/org.nativescript.firebasedemo-1/lib/x86/libNativeScript.so (Java_com_tns_Platform_callJSMethodNative+357)
12-09 14:40:13.401 104 104 F DEBUG : #38 pc 00861eda /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (offset 0x559000) (java.lang.Object com.tns.Platform.callJSMethodNative(int, java.lang.String, int, boolean, java.lang.Object[])+190)
12-09 14:40:13.401 104 104 F DEBUG : #39 pc 00863084 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (offset 0x559000) (java.lang.Object com.tns.Platform.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[])+440)
12-09 14:40:13.401 104 104 F DEBUG : #40 pc 00861a41 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (offset 0x559000) (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[])+1493)
12-09 14:40:13.401 104 104 F DEBUG : #41 pc 00861c2a /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (offset 0x559000) (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[])+158)
12-09 14:40:13.401 104 104 F DEBUG : #42 pc 00861cc6 /data/app/org.nativescript.firebasedemo-1/oat/x86/base.odex (offset 0x559000) (java.lang.Object com.tns.Platform.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[])+90)
from nativescript-plugin-firebase.
That is correct, do you know how to explain the issue to the team? Ill +1 it if you create the issue just let me know
thanks Eddy for the time
from nativescript-plugin-firebase.
Hi Eddy, I've been doing some checking and the error not appears in 4.4.4 (device and emulator)
from nativescript-plugin-firebase.
Related Issues (20)
- M1 Issue - FirebaseSDK HOT 4
- Several "session_start" event are created on iOS 15 HOT 1
- ERROR TypeError: firebase.init is not a function.
- AdMob error: TypeError: Cannot set property 'resolve' of undefined
- Class constructor ContentView cannot be invoked without 'new'
- Android App Not working with NS 8.2. HOT 42
- A problem occurred configuring root project 'firebase'.
- microsoft login
- Android 12 background notification led to crash (PendingIntent) HOT 6
- Unable to run new deployment HOT 1
- ion
- Error trying to install @nativescript/firebase
- barcode scanning issue - iPhone 13 Pro and iPhone 13 Pro max
- Cannot read property 'ads' of undefined on NativeScript 8.2.3 HOT 1
- Plugin with id 'com.google.gms.google-services' not found. HOT 13
- SetValue of type Date Error on iOS
- Barcode Scanning issue on native script 8 with native camera control
- Mark this repository as deprecated HOT 1
- Firebase Authentication functions are giving error "No reference found.
- Firebase Messaging crash issue in Android 13 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-plugin-firebase.