[Firebase database] Uncaught exception in Firebase Database runloop (19.3.0)
See original GitHub issueDear team, I met this issue in my project and have no idea to fix it. Help me please.
My project has implemented firebase data before (11.8.0) and run normally. I recently add firebase crashlytics sdk (database update to 19.3.0) and get crash when running project with release mode (minifyEnable = true).
My gradle file
implementation("com.google.firebase:firebase-core:17.4.1")
implementation("com.google.firebase:firebase-analytics:17.2.3")
implementation("com.google.firebase:firebase-messaging:20.1.7")
implementation("com.google.firebase:firebase-database:19.3.0")
implementation("com.google.firebase:firebase-auth:19.3.1")
implementation("com.google.firebase:firebase-crashlytics:17.0.0")
My code
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference dbRef = database.getReference("/mydbkey");
dbRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
// Do my stuff
}
@Override
public void onCancelled(DatabaseError databaseError) {
// Do my stuff
}
});
The crashed message
Fatal Exception: java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (19.3.0). 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:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6820) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:922) Caused by java.lang.NoSuchMethodError: No virtual method object()Lcom//android/am4; in class Lcom//android/am4; or its super classes (declaration of 'com..android.am4’ appears in /data/app/com..dev-fG3zQ87gx1RUrYnvZ7rj7g==/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:231) at com.google.firebase.database.connection.Connection.sendData(Connection.java:243) at com.google.firebase.database.connection.Connection.sendRequest(Connection.java:117) at com.google.firebase.database.connection.PersistentConnectionImpl.sendSensitive(PersistentConnectionImpl.java:1177) at com.google.firebase.database.connection.PersistentConnectionImpl.sendAction(PersistentConnectionImpl.java:1164) at com.google.firebase.database.connection.PersistentConnectionImpl.sendStats(PersistentConnectionImpl.java:1116) at com.google.firebase.database.connection.PersistentConnectionImpl.sendConnectStats(PersistentConnectionImpl.java:1159) at com.google.firebase.database.connection.PersistentConnectionImpl.onReady(PersistentConnectionImpl.java:310) at com.google.firebase.database.connection.Connection.onConnectionReady(Connection.java:217) at com.google.firebase.database.connection.Connection.onHandshake(Connection.java:210) at com.google.firebase.database.connection.Connection.onControlMessage(Connection.java:182) at com.google.firebase.database.connection.Connection.onMessage(Connection.java:132) at com.google.firebase.database.connection.WebsocketConnection.appendFrame(WebsocketConnection.java:256) at com.google.firebase.database.connection.WebsocketConnection.handleIncomingFrame(WebsocketConnection.java:303) at com.google.firebase.database.connection.WebsocketConnection.access$000(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:458) 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:764)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (1 by maintainers)
Top GitHub Comments
I encountered what I believe is the same issue. See https://github.com/firebase/firebase-android-sdk/issues/2050
And found a fix:
In order to avoid this crash, you need to exclude Json library code from shrinking/obfuscation by adding the following line to your proguard rules file:
-keep class org.json.* { *; }
Am facing the same problem tried your all solution but no use, Issue remains…any other solution??