I'm trying to extend the Firebase plugin with the ability to remove listeners. On Android the Firebase SDK offers the following method signatures (found here):

So these methods either expect an implementation of the ChildEventListener or ValueEventListener Interface.
Whichever is called first succeeds!, so when first calling removeEventListener(myValueEventListener) all is fine, but if I then call removeEventListener(myChildEventListener) the app will crash (and vice versa!) with the following stacktrace:
JNI ERROR (app bug): attempt to pass an instance of com.tns.gen.com.google.firebase.database.ChildEventListener as argument 1 to void com.google.firebase.database.Query.removeEventListener(com.google.firebase.database.ValueEventListener)
My guess is something is cached and the runtime expects the same signature for the same method the next time.. which is not what the Firebase SDK wants me to pass in..
Firebase Android SDK: 9.4.0
Those last two steps can be reversed with the same outcome.

Hi @EddyVerbruggen, I coulnd't reproduce your problem.
After building following your instructions I did:
Calling js method onClick failed
TypeError: firebase.removeEventListener is not a function
File: "/data/data/org.nativescript.firebasedemo/files/app/main-view-model.js, line: 448, column: 13
which looks like an application error.
Ah snap, that's because I removed that method and didn't yet adjust the demo app. Please pull the demo app again and do exactly the same to see the crash (hope you still have it on your machine!).

@EddyVerbruggen, thank you for the feedback, I managed to reproduce your problem and we'll take a look.
EDIT: @EddyVerbruggen, thanks for reporting this issue, the fix will make it into the next release.
That's fantastic! Thanks for checking and fixings this so incredibly quickly! 馃帀
2.3.0 FTW!
JS: firebase.addChildEventListener added
JS: firebase.addValueEventListener added
JS: Removing listener at path /users: com.tns.gen.com.google.firebase.database.ChildEventListener@52be7010
JS: firebase.doRemoveChildEventListenerForUsers success
JS: Removing listener at path /companies: com.tns.gen.com.google.firebase.database.ValueEventListener@52b5d2c0
JS: firebase.doRemoveValueEventListenersForCompanies success
馃帀馃帀馃帀馃帀馃帀馃帀馃帀馃帀馃帀馃帀馃帀馃帀馃帀