helpcrunch / android-sdk-demo

Public demo for HelpCrunch Android SDK
Apache License 2.0
9 stars 1 forks source link

Firebase Error in production #62

Closed francescogatto closed 2 years ago

francescogatto commented 2 years ago

HI

I have this error in crashlytics:

Fatal Exception: java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (20.0.5). If you are not already on the latest version of the Firebase SDKs, try updating your dependencies. Should this problem persist, please file a report at https://github.com/firebase/firebase-android-sdk
       at com.google.firebase.database.android.AndroidPlatform$1$1.run(AndroidPlatform.java:96)
       at android.os.Handler.handleCallback(Handler.java:888)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:213)
       at android.app.ActivityThread.main(ActivityThread.java:8178)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by java.lang.NoSuchMethodError: No virtual method object()Lcom/helpcrunch/chat/jw1; in class Lcom/helpcrunch/chat/jw1; or its super classes (declaration of 'com.helpcrunch.chat.jw1' appears in base.apk!classes3.dex)
       at com.google.firebase.database.util.JsonMapper.serializeJsonValue(JsonMapper.java:69)
       at com.google.firebase.database.util.JsonMapper.serializeJsonValue(JsonMapper.java:58)
       at com.google.firebase.database.util.JsonMapper.serializeJson(JsonMapper.java:38)
       at com.google.firebase.database.connection.WebsocketConnection.send(WebsocketConnection.java:234)
       at com.google.firebase.database.connection.Connection.sendData(Connection.java:246)
       at com.google.firebase.database.connection.Connection.sendRequest(Connection.java:120)
       at com.google.firebase.database.connection.PersistentConnectionImpl.sendSensitive(PersistentConnectionImpl.java:1427)
       at com.google.firebase.database.connection.PersistentConnectionImpl.sendAction(PersistentConnectionImpl.java:1414)
       at com.google.firebase.database.connection.PersistentConnectionImpl.sendStats(PersistentConnectionImpl.java:1366)
       at com.google.firebase.database.connection.PersistentConnectionImpl.sendConnectStats(PersistentConnectionImpl.java:1409)
       at com.google.firebase.database.connection.PersistentConnectionImpl.onReady(PersistentConnectionImpl.java:365)
       at com.google.firebase.database.connection.Connection.onConnectionReady(Connection.java:220)
       at com.google.firebase.database.connection.Connection.onHandshake(Connection.java:213)
       at com.google.firebase.database.connection.Connection.onControlMessage(Connection.java:185)
       at com.google.firebase.database.connection.Connection.onMessage(Connection.java:135)
       at com.google.firebase.database.connection.WebsocketConnection.appendFrame(WebsocketConnection.java:259)
       at com.google.firebase.database.connection.WebsocketConnection.handleIncomingFrame(WebsocketConnection.java:306)
       at com.google.firebase.database.connection.WebsocketConnection.access$500(WebsocketConnection.java:34)
       at com.google.firebase.database.connection.WebsocketConnection$WSClientTubesock$2.run(WebsocketConnection.java:86)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:929)
TalbotGooday commented 2 years ago

This is probably another compatibility bug. Please compare dependency versions with our dependencies https://github.com/helpcrunch/android-sdk-demo/blob/master/DEPENDENCY_LIST.md

francescogatto commented 2 years ago

Hi! HEre my dependencies for firebase and still have crashes! Please is very important because it happens without opening your Help Activity

implementation platform('com.google.firebase:firebase-bom:29.1.0') implementation 'com.google.firebase:firebase-inappmessaging-display-ktx' implementation 'com.google.firebase:firebase-analytics-ktx' implementation 'com.google.firebase:firebase-crashlytics-ktx' implementation 'com.google.firebase:firebase-config-ktx' implementation 'com.google.firebase:firebase-messaging-ktx' implementation 'com.google.firebase:firebase-auth-ktx' implementation 'com.google.firebase:firebase-database-ktx' implementation 'com.google.firebase:firebase-dynamic-links-ktx' implementation 'com.google.firebase:firebase-storage-ktx' implementation 'com.google.firebase:firebase-firestore-ktx'

Update: Seems happen when i try to write to my realtime database in this way:

fun incrementCounter() {
        if(isCounterPaymentsEnabled) {
            val valueEventListener = object : ValueEventListener {
                override fun onDataChange(snapshot: DataSnapshot) {
                    var count = snapshot.value as Long
                    count += 1
                    FirebaseDatabase.getInstance().reference.child("counter").setValue(count)
                    FirebaseDatabase.getInstance().reference.child("counter").removeEventListener(this)
                }

                override fun onCancelled(error: DatabaseError) {
                    e { "$error" }
                }

            }
            FirebaseDatabase.getInstance().reference.child("counter").addValueEventListener(valueEventListener)
        }

isCounterPaymentsEnabled is a remote config variable, so i can disable it. The crash started when i activated it

TalbotGooday commented 2 years ago

Please try to update HelpCrunch version to 3.2.3-rc-07 and Firebase BOM to 30.2.0. I hope it helps

francescogatto commented 2 years ago

I will do in the next release.

Il Ven 29 Lug 2022, 09:55 Alexey Mostovoy @.***> ha scritto:

Please try to update HelpCrunch version to 3.2.3-rc-07 and Firebase BOM to 30.2.0. I hope it helps

— Reply to this email directly, view it on GitHub https://github.com/helpcrunch/android-sdk-demo/issues/62#issuecomment-1198987725, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAGC7FODWKU3WG7KLUQHC3VWOE5PANCNFSM54ZF6KKQ . You are receiving this because you authored the thread.Message ID: @.***>