I usually like to capture the logcat this way because it provide some other helpful critical information that can make these sorts of issues easier to diagnose.
adb logcat -v threadtime > logcat_output.txt.
You can attach that to the issue or DM me and we can take a look.
That last paste seems helpful.
What’s happening
The crash isn’t a minification problem. Look at the lines right before the abort:
android.net.ConnectivityManager$TooManyRequestsException
at ConnectivityManager.registerNetworkCallback(...)
at livekit.org.webrtc.NetworkMonitorAutoDetect.<init>(...)
at livekit.org.webrtc.NetworkMonitor.startMonitoring(...)
rtc E # Fatal error in: jvm.cc, line 81 # Check failed: false
libc A Fatal signal 6 (SIGABRT) ... network_thread
Android limits how many active network callbacks an app can register at once (about 100 per app). WebRTC registers a couple of these every time it starts monitoring the network, and it unregisters them only when that connection is fully torn down. When the app crosses the limit, registerNetworkCallback throws TooManyRequestsException. Because this happens inside a native WebRTC call, the unhandled exception turns into a hard SIGABRT instead of a normal error. That’s the crash you’re seeing on network_thread.
Why it’s intermittent and hard to reproduce
You mentioned the important detail: “we create a new room every time.” That’s the trigger. Each new Room registers more network callbacks, and if the previous room isn’t fully released, those callbacks leak. After ~100 connect cycles, the next connect tips over the limit and crashes. That’s why it only shows up in production after the app has been running a while, and never on a clean test.
The fix
Make sure every Room is fully released before you create the next one:
- Call
room.disconnect() and release the room object (don’t just drop the reference and create a new one).
- Even better: create one
Room once and reuse it — call connect() / disconnect() on the same instance instead of new Room() on every button tap.
How to confirm it’s the leak
Run this while reconnecting a few times:
adb shell dumpsys connectivity | grep <your.package.name>
You’ll see the registered callback count increase on each connect. If it keeps growing and never drops after you disconnect, the rooms aren’t being released — that’s the leak that eventually causes the crash.
Once that’s fixed, the SIGABRT should stop.