Originally created by @lukeIam on GitHub (Jan 12, 2025).
What was the Problem?
Starting the android app always results in an app crash as long as the server is reachable.
I can see the full interface (also indicating the server is connected) and can even start playing an audiobook if I'm fast.
Then I get the Android message that ABS has crashed.
Workaround:
disable network connections
start abs and wait 10s
enable network again
use ABS as normal (no crash - everything works)
Steps to Reproduce the Issue
start ABS (no other apps running)
What was Expected?
No crash after start
Phone Model
Google Pixel 7
Phone OS
Android 15
Audiobookshelf App Version
Android App - 0.9.77-beta
Installation Source
Google Play Store
Additional Notes
App version 0.9.77-beta
Server Version: 2.17.7 (also occurred with an older version)
logcat -b crash:
01-12 12:00:28.370 31016 31169 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
01-12 12:00:28.370 31016 31169 E AndroidRuntime: Process: com.audiobookshelf.app, PID: 31016
01-12 12:00:28.370 31016 31169 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 140112784 byte allocation with 100663296 free bytes and 111MB until OOM, target footprint 520696000, growth limit 536870912
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.lang.StringFactory.newStringFromUtf16Bytes(Native Method)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.lang.StringUTF16.newString(StringUTF16.java:1141)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.lang.StringBuilder.toString(StringBuilder.java:475)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at org.json.JSONStringer.toString(JSONStringer.java:443)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at org.json.JSONObject.toString(JSONObject.java:703)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.postRequest(ApiHandler.kt:64)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.sendSyncLocalSessions(ApiHandler.kt:357)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.syncLocalSessionsWithServer$lambda$4(AbsDatabase.kt:232)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.$r8$lambda$pnHB3jg7r_TQOFKHlbjIVe6y0i0(Unknown Source:0)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase$$ExternalSyntheticLambda0.invoke(Unknown Source:4)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.syncLocalMediaProgressForUser$lambda$25(ApiHandler.kt:413)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.$r8$lambda$DuqQfU3xJN73k-Ul8cnKrEZgHls(Unknown Source:0)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler$$ExternalSyntheticLambda12.invoke(Unknown Source:8)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.getCurrentUser$lambda$0(ApiHandler.kt:150)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.$r8$lambda$ZPxn1vUH6yoFRjSBbjSLl8U83eE(Unknown Source:0)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler$$ExternalSyntheticLambda14.invoke(Unknown Source:6)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler$makeRequest$1.onResponse(ApiHandler.kt:130)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012)
Originally created by @lukeIam on GitHub (Jan 12, 2025).
### What was the Problem?
Starting the android app always results in an app crash as long as the server is reachable.
I can see the full interface (also indicating the server is connected) and can even start playing an audiobook if I'm fast.
Then I get the Android message that ABS has crashed.
Workaround:
1. disable network connections
2. start abs and wait 10s
3. enable network again
4. use ABS as normal (no crash - everything works)
### Steps to Reproduce the Issue
1. start ABS (no other apps running)
### What was Expected?
No crash after start
### Phone Model
Google Pixel 7
### Phone OS
Android 15
### Audiobookshelf App Version
Android App - 0.9.77-beta
### Installation Source
Google Play Store
### Additional Notes
App version 0.9.77-beta
Server Version: 2.17.7 (also occurred with an older version)
logcat -b crash:
```
01-12 12:00:28.370 31016 31169 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
01-12 12:00:28.370 31016 31169 E AndroidRuntime: Process: com.audiobookshelf.app, PID: 31016
01-12 12:00:28.370 31016 31169 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 140112784 byte allocation with 100663296 free bytes and 111MB until OOM, target footprint 520696000, growth limit 536870912
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.lang.StringFactory.newStringFromUtf16Bytes(Native Method)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.lang.StringUTF16.newString(StringUTF16.java:1141)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.lang.StringBuilder.toString(StringBuilder.java:475)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at org.json.JSONStringer.toString(JSONStringer.java:443)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at org.json.JSONObject.toString(JSONObject.java:703)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.postRequest(ApiHandler.kt:64)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.sendSyncLocalSessions(ApiHandler.kt:357)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.syncLocalSessionsWithServer$lambda$4(AbsDatabase.kt:232)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.$r8$lambda$pnHB3jg7r_TQOFKHlbjIVe6y0i0(Unknown Source:0)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase$$ExternalSyntheticLambda0.invoke(Unknown Source:4)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.syncLocalMediaProgressForUser$lambda$25(ApiHandler.kt:413)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.$r8$lambda$DuqQfU3xJN73k-Ul8cnKrEZgHls(Unknown Source:0)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler$$ExternalSyntheticLambda12.invoke(Unknown Source:8)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.getCurrentUser$lambda$0(ApiHandler.kt:150)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.$r8$lambda$ZPxn1vUH6yoFRjSBbjSLl8U83eE(Unknown Source:0)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler$$ExternalSyntheticLambda14.invoke(Unknown Source:6)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler$makeRequest$1.onResponse(ApiHandler.kt:130)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
01-12 12:00:28.370 31016 31169 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012)
```
adam
added the bugandroid labels 2026-04-24 23:49:10 +02:00
@advplyr is there a way to get more logs out of the app?
Or anything else I can do to provide better information?
@lukeIam commented on GitHub (Jan 14, 2025):
@advplyr is there a way to get more logs out of the app?
Or anything else I can do to provide better information?
What constitutes as reachable? LAN, reverse proxy over mobile network or another Wi-Fi network, VPN, etc?
@nichwall commented on GitHub (Jan 14, 2025):
What constitutes as reachable? LAN, reverse proxy over mobile network or another Wi-Fi network, VPN, etc?
What constitutes as reachable? LAN, reverse proxy over mobile network or another Wi-Fi network, VPN, etc?
Server ethernet connected to the access point (nginx reverse proxied) where the pixel is connected to -> no vpns active in this scenario.
"reachable" means for the connection status indicator in the app turns green + I can shortly stream an non-offline audiobook before the crash -> server connected and usable
But thinking about the error message says the crash happens during: com.audiobookshelf.app.server.ApiHandler.sendSyncLocalSessions
There is something special: I listened to an offline book over that time span of ~3 weeks (start to end) without any server connection (no internet). Also when checking this book in the web browser it shows no progress nor history.
Could it be that the app is crashing when it tries to upload the listen history of this book? The books I started after is showing progress in the browser (but I'm still actively listening to it).
Looks I can fix this by reinstalling the app and sacrificing the listen history of a single book...
question: do you want to investigate this problem further or should I just (try to) fix my local problem?
Edit: 140112784 bytes ~= 140mb - quite a lot for some listen history
@lukeIam commented on GitHub (Jan 14, 2025):
> What constitutes as reachable? LAN, reverse proxy over mobile network or another Wi-Fi network, VPN, etc?
Server ethernet connected to the access point (nginx reverse proxied) where the pixel is connected to -> no vpns active in this scenario.
"reachable" means for the connection status indicator in the app turns green + I can shortly stream an non-offline audiobook before the crash -> server connected and usable
But thinking about the error message says the crash happens during:
`com.audiobookshelf.app.server.ApiHandler.sendSyncLocalSessions`
There is something special: I listened to an offline book over that time span of ~3 weeks (start to end) without any server connection (no internet). Also when checking this book in the web browser it shows no progress nor history.
Could it be that the app is crashing when it tries to upload the listen history of this book? The books I started after is showing progress in the browser (but I'm still actively listening to it).
Looks I can fix this by reinstalling the app and sacrificing the listen history of a single book...
question: do you want to investigate this problem further or should I just (try to) fix my local problem?
Edit: 140112784 bytes ~= 140mb - quite a lot for some listen history
Could it be that the app is crashing when it tries to upload the listen history of this book? The books I started after is showing progress in the browser (but I'm still actively listening to it).
Looks I can fix this by reinstalling the app and sacrificing the listen history of a single book... question: do you want to investigate this problem further or should I just (try to) fix my local problem?
Edit: 140112784 bytes ~= 140mb - quite a lot for some listen history
Yeah this is most likely the issue.
Currently the listening sessions store far too much data and the plan is to refactor that.
I can see if in this next release I can split up the requests
@advplyr commented on GitHub (Jan 14, 2025):
> Could it be that the app is crashing when it tries to upload the listen history of this book? The books I started after is showing progress in the browser (but I'm still actively listening to it).
>
> Looks I can fix this by reinstalling the app and sacrificing the listen history of a single book... question: do you want to investigate this problem further or should I just (try to) fix my local problem?
>
> Edit: 140112784 bytes ~= 140mb - quite a lot for some listen history
Yeah this is most likely the issue.
Currently the listening sessions store far too much data and the plan is to refactor that.
I can see if in this next release I can split up the requests
I have the same behavior. I had to delete all locally stored books. Even deleting App Data and cache was not solving the issue, only deleting the locally stored books. After that the crashing disappears for some time.
Can I assist with some logs when this reappears?
(Btw: Also Android 15, Pixel 7 Pro)
@tuffelh commented on GitHub (Jan 21, 2026):
I have the same behavior. I had to delete all locally stored books. Even deleting App Data and cache was not solving the issue, only deleting the locally stored books. After that the crashing disappears for some time.
Can I assist with some logs when this reappears?
(Btw: Also Android 15, Pixel 7 Pro)
I have the same behavior. I had to delete all locally stored books. Even deleting App Data and cache was not solving the issue, only deleting the locally stored books. After that the crashing disappears for some time.
Can I assist with some logs when this reappears?
(Btw: Also Android 15, Pixel 7 Pro)
Yeah, any logs would be useful if it starts crashing again.
@nichwall commented on GitHub (Jan 21, 2026):
> I have the same behavior. I had to delete all locally stored books. Even deleting App Data and cache was not solving the issue, only deleting the locally stored books. After that the crashing disappears for some time.
> Can I assist with some logs when this reappears?
> (Btw: Also Android 15, Pixel 7 Pro)
Yeah, any logs would be useful if it starts crashing again.
I have the same behavior. I had to delete all locally stored books. Even deleting App Data and cache was not solving the issue, only deleting the locally stored books. After that the crashing disappears for some time.
Can I assist with some logs when this reappears?
(Btw: Also Android 15, Pixel 7 Pro)
Yeah, any logs would be useful if it starts crashing again.
@nichwall commented on GitHub (Jan 21, 2026):
> I have the same behavior. I had to delete all locally stored books. Even deleting App Data and cache was not solving the issue, only deleting the locally stored books. After that the crashing disappears for some time.
> Can I assist with some logs when this reappears?
> (Btw: Also Android 15, Pixel 7 Pro)
Yeah, any logs would be useful if it starts crashing again.
Software/Model: Android 15, Samsung Galaxy S21 5G (SM-G991U)
App Version: 0.12.0-beta (Google Play Store)
Server Version: 2.32.1 (Docker)
And to put things in perspective - last week I did a complete download of a rather large podcast (~700x 45-minute episodes) to a different, archival library and removed it from my main podcast library, so ...lots of changes to the server database.
In the modern age of the internet, ChatGPT suggests "large JSON serialization of session data; developers can implement chunked syncing or streaming JSON, which would prevent OOM on both older and newer phones."
In the crash summary, this happens 5 times before the app quietly exits, and as @lukeIam mentioned, after the interface loads and connects to the server, I have a few seconds to scramble around and get SOMETHING to work before it exits (in my case, accessing the app's internal log in Settings, which was blank).
Clearing my cache did not fix it, but clearing app data completely (and relogging) did clear it up for now.
Unfortunately the crash log doesn't give much more information than what was already given, but I grabbed one of the 5 exceptions out of the main system log and included what I thought looked like pertinent lines outside the exception itself:
03-11 12:53:31.652 28526 28534 I iobookshelf.app: Background concurrent copying GC freed 33MB AllocSpace bytes, 20(320KB) LOS objects, 10% free, 413MB/461MB, paused 93us,58us total 383.715ms
03-11 12:53:31.818 28526 28534 I iobookshelf.app: Background young concurrent copying GC freed 10MB AllocSpace bytes, 11(36MB) LOS objects, 10% free, 404MB/452MB, paused 79us,39us total 104.392ms
03-11 12:53:32.053 1890 2955 D ActivityManager: freezing 27018 com.sec.android.app.desktoplauncher
03-11 12:53:32.128 1890 4224 D MARs:ActiveTrafficFilter: filter : com.whatsapp(0)
03-11 12:53:32.129 1890 4224 D FreecessController: com.whatsapp(10428) is important[8]
03-11 12:53:32.235 1561 18256 I sensors-hal: handle_sns_std_sensor_event:155, [SSC_LIGHT] P: 25(25),m:1,c:2,b:83,wb:0,r:44,bl:10,16:32
03-11 12:53:32.254 28526 28600 I iobookshelf.app: Waiting for a blocking GC Alloc
03-11 12:53:32.284 6607 6607 I wpa_supplicant: Heartbeat 533
03-11 12:53:32.297 28526 28534 I iobookshelf.app: Background concurrent copying GC freed 8380KB AllocSpace bytes, 1(115MB) LOS objects, 11% free, 362MB/410MB, paused 114us,26us total 369.267ms
03-11 12:53:32.297 28526 28600 I iobookshelf.app: WaitForGcToComplete blocked Alloc on Background for 43.035ms
03-11 12:53:32.601 28526 28600 I iobookshelf.app: Waiting for a blocking GC Alloc
03-11 12:53:32.724 28526 28534 I iobookshelf.app: Background concurrent copying GC freed 5433KB AllocSpace bytes, 2(108MB) LOS objects, 10% free, 398MB/446MB, paused 77us,24us total 351.384ms
03-11 12:53:32.724 28526 28600 I iobookshelf.app: WaitForGcToComplete blocked Alloc on Background for 123.701ms
03-11 12:53:32.822 28526 28600 I iobookshelf.app: Starting a blocking GC Alloc
03-11 12:53:32.859 28526 28600 I iobookshelf.app: Alloc young concurrent copying GC freed 2156KB AllocSpace bytes, 0(0B) LOS objects, 10% free, 399MB/446MB, paused 35us,16us total 36.797ms
03-11 12:53:32.859 28526 28600 I iobookshelf.app: Forcing collection of SoftReferences for 117MB allocation
03-11 12:53:32.986 1561 18242 I sensors-hal: handle_sns_client_event:261, auto_rotation_debug_2 mode,255, type,1,0 acc,0.213,0.053,9.770, ar,0, ver,12
03-11 12:53:33.177 792 792 D io_stats: !@ 8,0 r 37632492 933117108 w 7265357 114534376 d 2036474 109137360 f 0 0 iot 15478068 0 th 0 0 0 pt 0 inp 0 0 178648.464
03-11 12:53:33.178 792 792 D io_stats: !@ Read_top(KB): iobookshelf.app(28526) 48144 binder:24119_2(24119) 36240 facebook.katana(28280) 6244
03-11 12:53:33.178 792 792 D io_stats: !@ Write_top(KB): kworker/u16:4(25256) 33160 system_server(1890) 848 ox.securefolder(28415) 452
03-11 12:53:33.327 28526 28600 I iobookshelf.app: Alloc concurrent copying GC freed 3068KB AllocSpace bytes, 2(264KB) LOS objects, 10% free, 395MB/443MB, paused 22us,27us total 468.075ms
03-11 12:53:33.330 28526 28600 W iobookshelf.app: Throwing OutOfMemoryError "Failed to allocate a 122763568 byte allocation with 50298880 free bytes and 116MB until OOM, target footprint 465320080, growth limit 536870912" (VmSize 43606316 kB)
03-11 12:53:33.331 28526 28600 I iobookshelf.app: Starting a blocking GC Alloc
03-11 12:53:33.338 28526 28600 I iobookshelf.app: Alloc young concurrent copying GC freed 47KB AllocSpace bytes, 0(0B) LOS objects, 10% free, 395MB/443MB, paused 38us,16us total 6.999ms
03-11 12:53:33.338 28526 28600 I iobookshelf.app: Forcing collection of SoftReferences for 117MB allocation
03-11 12:53:33.403 1890 4782 D SemWifiUsabilityStatsMonitor: onWifiUsabilityStats - seqNum 13218, isSameBssidAndFreq true
03-11 12:53:33.410 1890 3251 I SemWifiLinkQualityMonitor: Link stat: 747 / 78 / 1.00 (6) / 1200 / -30.0 || 100.0 : 1200.00 / 0.5 : 1.00 / 0.55 : 0.10 / G (G) || 844619d55240: 0.087 / 91.889 / / N || N N / 0 / Y 2.0 / Y 0 / 178648692 0
03-11 12:53:33.578 2077 2299 D BufferPoolAccessor2.0: evictor expired: 1, evicted: 0
03-11 12:53:33.587 2044 27357 D BufferPoolAccessor2.0: evictor expired: 1, evicted: 0
03-11 12:53:33.812 28526 28600 I iobookshelf.app: Alloc concurrent copying GC freed 16KB AllocSpace bytes, 0(0B) LOS objects, 10% free, 395MB/443MB, paused 36us,29us total 474.263ms
03-11 12:53:33.812 28526 28600 W iobookshelf.app: Throwing OutOfMemoryError "Failed to allocate a 122763568 byte allocation with 50331648 free bytes and 116MB until OOM, target footprint 465319520, growth limit 536870912" (VmSize 43606316 kB)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: FATAL EXCEPTION: CapacitorPlugins
03-11 12:53:33.815 28526 28600 E AndroidRuntime: Process: com.audiobookshelf.app, PID: 28526
03-11 12:53:33.815 28526 28600 E AndroidRuntime: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:846)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.Bridge.$r8$lambda$FNYM7cvgeBk0k8YXQH7M96Mrf-c(Unknown Source:0)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.Bridge$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:959)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:257)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.Looper.loop(Looper.java:342)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:85)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:138)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:837)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: ... 7 more
03-11 12:53:33.815 28526 28600 E AndroidRuntime: Caused by: java.lang.OutOfMemoryError: Failed to allocate a 122763568 byte allocation with 50331648 free bytes and 116MB until OOM, target footprint 465319520, growth limit 536870912
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at java.lang.StringFactory.newStringFromUtf16Bytes(Native Method)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at java.lang.StringUTF16.newString(StringUTF16.java:1141)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at java.lang.StringBuilder.toString(StringBuilder.java:479)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at org.json.JSONStringer.toString(JSONStringer.java:443)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at org.json.JSONObject.toString(JSONObject.java:703)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.postRequest(ApiHandler.kt:77)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.sendSyncLocalSessions(ApiHandler.kt:754)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.syncLocalSessionsWithServer$lambda$5(AbsDatabase.kt:295)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.$r8$lambda$PNU-BIh04eZuWqd4qaha3sBvAoA(Unknown Source:0)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase$$ExternalSyntheticLambda3.invoke(D8$$SyntheticClass:0)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.syncLocalMediaProgressForUser(ApiHandler.kt:788)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.syncLocalSessionsWithServer(AbsDatabase.kt:291)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: ... 10 more
03-11 12:53:33.827 1890 28880 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
03-11 12:53:33.832 1890 4121 D Debug : low && ship && 3rdparty app crash, do not dump
03-11 12:53:33.834 1890 28881 W ActivityManager: crash : com.audiobookshelf.app,10323
03-11 12:53:33.835 1890 4121 W ActivityTaskManager: Force finishing activity com.audiobookshelf.app/.MainActivity
@depwl9992 commented on GitHub (Mar 11, 2026):
I managed to get my own ADB logs of this today.
Software/Model: Android 15, Samsung Galaxy S21 5G (SM-G991U)
App Version: 0.12.0-beta (Google Play Store)
Server Version: 2.32.1 (Docker)
And to put things in perspective - last week I did a complete download of a rather large podcast (~700x 45-minute episodes) to a different, archival library and removed it from my main podcast library, so ...lots of changes to the server database.
In the modern age of the internet, ChatGPT suggests "large JSON serialization of session data; developers can implement chunked syncing or streaming JSON, which would prevent OOM on both older and newer phones."
In the crash summary, this happens 5 times before the app quietly exits, and as @lukeIam mentioned, after the interface loads and connects to the server, I have a few seconds to scramble around and get SOMETHING to work before it exits (in my case, accessing the app's internal log in Settings, which was blank).
Clearing my cache did not fix it, but clearing app data completely (and relogging) did clear it up for now.
Unfortunately the crash log doesn't give much more information than what was already given, but I grabbed one of the 5 exceptions out of the main system log and included what I thought looked like pertinent lines outside the exception itself:
```
03-11 12:53:31.652 28526 28534 I iobookshelf.app: Background concurrent copying GC freed 33MB AllocSpace bytes, 20(320KB) LOS objects, 10% free, 413MB/461MB, paused 93us,58us total 383.715ms
03-11 12:53:31.818 28526 28534 I iobookshelf.app: Background young concurrent copying GC freed 10MB AllocSpace bytes, 11(36MB) LOS objects, 10% free, 404MB/452MB, paused 79us,39us total 104.392ms
03-11 12:53:32.053 1890 2955 D ActivityManager: freezing 27018 com.sec.android.app.desktoplauncher
03-11 12:53:32.128 1890 4224 D MARs:ActiveTrafficFilter: filter : com.whatsapp(0)
03-11 12:53:32.129 1890 4224 D FreecessController: com.whatsapp(10428) is important[8]
03-11 12:53:32.235 1561 18256 I sensors-hal: handle_sns_std_sensor_event:155, [SSC_LIGHT] P: 25(25),m:1,c:2,b:83,wb:0,r:44,bl:10,16:32
03-11 12:53:32.254 28526 28600 I iobookshelf.app: Waiting for a blocking GC Alloc
03-11 12:53:32.284 6607 6607 I wpa_supplicant: Heartbeat 533
03-11 12:53:32.297 28526 28534 I iobookshelf.app: Background concurrent copying GC freed 8380KB AllocSpace bytes, 1(115MB) LOS objects, 11% free, 362MB/410MB, paused 114us,26us total 369.267ms
03-11 12:53:32.297 28526 28600 I iobookshelf.app: WaitForGcToComplete blocked Alloc on Background for 43.035ms
03-11 12:53:32.601 28526 28600 I iobookshelf.app: Waiting for a blocking GC Alloc
03-11 12:53:32.724 28526 28534 I iobookshelf.app: Background concurrent copying GC freed 5433KB AllocSpace bytes, 2(108MB) LOS objects, 10% free, 398MB/446MB, paused 77us,24us total 351.384ms
03-11 12:53:32.724 28526 28600 I iobookshelf.app: WaitForGcToComplete blocked Alloc on Background for 123.701ms
03-11 12:53:32.822 28526 28600 I iobookshelf.app: Starting a blocking GC Alloc
03-11 12:53:32.859 28526 28600 I iobookshelf.app: Alloc young concurrent copying GC freed 2156KB AllocSpace bytes, 0(0B) LOS objects, 10% free, 399MB/446MB, paused 35us,16us total 36.797ms
03-11 12:53:32.859 28526 28600 I iobookshelf.app: Forcing collection of SoftReferences for 117MB allocation
03-11 12:53:32.986 1561 18242 I sensors-hal: handle_sns_client_event:261, auto_rotation_debug_2 mode,255, type,1,0 acc,0.213,0.053,9.770, ar,0, ver,12
03-11 12:53:33.177 792 792 D io_stats: !@ 8,0 r 37632492 933117108 w 7265357 114534376 d 2036474 109137360 f 0 0 iot 15478068 0 th 0 0 0 pt 0 inp 0 0 178648.464
03-11 12:53:33.178 792 792 D io_stats: !@ Read_top(KB): iobookshelf.app(28526) 48144 binder:24119_2(24119) 36240 facebook.katana(28280) 6244
03-11 12:53:33.178 792 792 D io_stats: !@ Write_top(KB): kworker/u16:4(25256) 33160 system_server(1890) 848 ox.securefolder(28415) 452
03-11 12:53:33.327 28526 28600 I iobookshelf.app: Alloc concurrent copying GC freed 3068KB AllocSpace bytes, 2(264KB) LOS objects, 10% free, 395MB/443MB, paused 22us,27us total 468.075ms
03-11 12:53:33.330 28526 28600 W iobookshelf.app: Throwing OutOfMemoryError "Failed to allocate a 122763568 byte allocation with 50298880 free bytes and 116MB until OOM, target footprint 465320080, growth limit 536870912" (VmSize 43606316 kB)
03-11 12:53:33.331 28526 28600 I iobookshelf.app: Starting a blocking GC Alloc
03-11 12:53:33.338 28526 28600 I iobookshelf.app: Alloc young concurrent copying GC freed 47KB AllocSpace bytes, 0(0B) LOS objects, 10% free, 395MB/443MB, paused 38us,16us total 6.999ms
03-11 12:53:33.338 28526 28600 I iobookshelf.app: Forcing collection of SoftReferences for 117MB allocation
03-11 12:53:33.403 1890 4782 D SemWifiUsabilityStatsMonitor: onWifiUsabilityStats - seqNum 13218, isSameBssidAndFreq true
03-11 12:53:33.410 1890 3251 I SemWifiLinkQualityMonitor: Link stat: 747 / 78 / 1.00 (6) / 1200 / -30.0 || 100.0 : 1200.00 / 0.5 : 1.00 / 0.55 : 0.10 / G (G) || 844619d55240: 0.087 / 91.889 / / N || N N / 0 / Y 2.0 / Y 0 / 178648692 0
03-11 12:53:33.578 2077 2299 D BufferPoolAccessor2.0: evictor expired: 1, evicted: 0
03-11 12:53:33.587 2044 27357 D BufferPoolAccessor2.0: evictor expired: 1, evicted: 0
03-11 12:53:33.812 28526 28600 I iobookshelf.app: Alloc concurrent copying GC freed 16KB AllocSpace bytes, 0(0B) LOS objects, 10% free, 395MB/443MB, paused 36us,29us total 474.263ms
03-11 12:53:33.812 28526 28600 W iobookshelf.app: Throwing OutOfMemoryError "Failed to allocate a 122763568 byte allocation with 50331648 free bytes and 116MB until OOM, target footprint 465319520, growth limit 536870912" (VmSize 43606316 kB)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: FATAL EXCEPTION: CapacitorPlugins
03-11 12:53:33.815 28526 28600 E AndroidRuntime: Process: com.audiobookshelf.app, PID: 28526
03-11 12:53:33.815 28526 28600 E AndroidRuntime: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:846)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.Bridge.$r8$lambda$FNYM7cvgeBk0k8YXQH7M96Mrf-c(Unknown Source:0)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.Bridge$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:959)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:257)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.Looper.loop(Looper.java:342)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:85)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:138)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:837)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: ... 7 more
03-11 12:53:33.815 28526 28600 E AndroidRuntime: Caused by: java.lang.OutOfMemoryError: Failed to allocate a 122763568 byte allocation with 50331648 free bytes and 116MB until OOM, target footprint 465319520, growth limit 536870912
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at java.lang.StringFactory.newStringFromUtf16Bytes(Native Method)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at java.lang.StringUTF16.newString(StringUTF16.java:1141)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at java.lang.StringBuilder.toString(StringBuilder.java:479)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at org.json.JSONStringer.toString(JSONStringer.java:443)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at org.json.JSONObject.toString(JSONObject.java:703)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.postRequest(ApiHandler.kt:77)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.sendSyncLocalSessions(ApiHandler.kt:754)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.syncLocalSessionsWithServer$lambda$5(AbsDatabase.kt:295)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.$r8$lambda$PNU-BIh04eZuWqd4qaha3sBvAoA(Unknown Source:0)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase$$ExternalSyntheticLambda3.invoke(D8$$SyntheticClass:0)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.server.ApiHandler.syncLocalMediaProgressForUser(ApiHandler.kt:788)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: at com.audiobookshelf.app.plugins.AbsDatabase.syncLocalSessionsWithServer(AbsDatabase.kt:291)
03-11 12:53:33.815 28526 28600 E AndroidRuntime: ... 10 more
03-11 12:53:33.827 1890 28880 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
03-11 12:53:33.832 1890 4121 D Debug : low && ship && 3rdparty app crash, do not dump
03-11 12:53:33.834 1890 28881 W ActivityManager: crash : com.audiobookshelf.app,10323
03-11 12:53:33.835 1890 4121 W ActivityTaskManager: Force finishing activity com.audiobookshelf.app/.MainActivity
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @lukeIam on GitHub (Jan 12, 2025).
What was the Problem?
Starting the android app always results in an app crash as long as the server is reachable.
I can see the full interface (also indicating the server is connected) and can even start playing an audiobook if I'm fast.
Then I get the Android message that ABS has crashed.
Workaround:
Steps to Reproduce the Issue
What was Expected?
No crash after start
Phone Model
Google Pixel 7
Phone OS
Android 15
Audiobookshelf App Version
Android App - 0.9.77-beta
Installation Source
Google Play Store
Additional Notes
App version 0.9.77-beta
Server Version: 2.17.7 (also occurred with an older version)
logcat -b crash:
@lukeIam commented on GitHub (Jan 14, 2025):
@advplyr is there a way to get more logs out of the app?
Or anything else I can do to provide better information?
@nichwall commented on GitHub (Jan 14, 2025):
What constitutes as reachable? LAN, reverse proxy over mobile network or another Wi-Fi network, VPN, etc?
@lukeIam commented on GitHub (Jan 14, 2025):
Server ethernet connected to the access point (nginx reverse proxied) where the pixel is connected to -> no vpns active in this scenario.
"reachable" means for the connection status indicator in the app turns green + I can shortly stream an non-offline audiobook before the crash -> server connected and usable
But thinking about the error message says the crash happens during:
com.audiobookshelf.app.server.ApiHandler.sendSyncLocalSessionsThere is something special: I listened to an offline book over that time span of ~3 weeks (start to end) without any server connection (no internet). Also when checking this book in the web browser it shows no progress nor history.
Could it be that the app is crashing when it tries to upload the listen history of this book? The books I started after is showing progress in the browser (but I'm still actively listening to it).
Looks I can fix this by reinstalling the app and sacrificing the listen history of a single book...
question: do you want to investigate this problem further or should I just (try to) fix my local problem?
Edit: 140112784 bytes ~= 140mb - quite a lot for some listen history
@advplyr commented on GitHub (Jan 14, 2025):
Yeah this is most likely the issue.
Currently the listening sessions store far too much data and the plan is to refactor that.
I can see if in this next release I can split up the requests
@tuffelh commented on GitHub (Jan 21, 2026):
I have the same behavior. I had to delete all locally stored books. Even deleting App Data and cache was not solving the issue, only deleting the locally stored books. After that the crashing disappears for some time.
Can I assist with some logs when this reappears?
(Btw: Also Android 15, Pixel 7 Pro)
@nichwall commented on GitHub (Jan 21, 2026):
Yeah, any logs would be useful if it starts crashing again.
@nichwall commented on GitHub (Jan 21, 2026):
Yeah, any logs would be useful if it starts crashing again.
@depwl9992 commented on GitHub (Mar 11, 2026):
I managed to get my own ADB logs of this today.
Software/Model: Android 15, Samsung Galaxy S21 5G (SM-G991U)
App Version: 0.12.0-beta (Google Play Store)
Server Version: 2.32.1 (Docker)
And to put things in perspective - last week I did a complete download of a rather large podcast (~700x 45-minute episodes) to a different, archival library and removed it from my main podcast library, so ...lots of changes to the server database.
In the modern age of the internet, ChatGPT suggests "large JSON serialization of session data; developers can implement chunked syncing or streaming JSON, which would prevent OOM on both older and newer phones."
In the crash summary, this happens 5 times before the app quietly exits, and as @lukeIam mentioned, after the interface loads and connects to the server, I have a few seconds to scramble around and get SOMETHING to work before it exits (in my case, accessing the app's internal log in Settings, which was blank).
Clearing my cache did not fix it, but clearing app data completely (and relogging) did clear it up for now.
Unfortunately the crash log doesn't give much more information than what was already given, but I grabbed one of the 5 exceptions out of the main system log and included what I thought looked like pertinent lines outside the exception itself: