App keeps crashing

App version:3.8.0 (095f60da8)

Android version: 13 (Lineage 20)

Device model: Redmi7a

Expected behaviour: No crashes when listening to podcasts

Current behaviour: App keeps crashing, sometimes every minutes

First occurred: (e.g. about x days/weeks ago)
It started weeks ago but was “acceptable” (max once per day) but this morning, at least 10 times in 1 hour

Steps to reproduce:
I just started listening to a podcast like normal

Environment: Didn’t change anything (except download new episodes of my podcast which I do daily. I use the same Bluetooth headphone as usual

Crash info:

Environment

Android version: 13
OS version: 4.9.337-lineageos-g048a3a0ada9d
AntennaPod version: 3.8.0
Model: Redmi 7A
Device: pine
Product: lineage_Mi439

Crash info

Time: 14-06-2025 01:22:34
AntennaPod version: 3.8.0

StackTrace

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.media.session.MediaSessionCompat.setMetadata(android.support.v4.media.MediaMetadataCompat)' on a null object reference
	at de.danoeh.antennapod.playback.service.PlaybackService.updateMediaSessionMetadata(SourceFile:1386)
	at de.danoeh.antennapod.playback.service.PlaybackService.lambda$setupNotification$12(SourceFile:1438)
	at de.danoeh.antennapod.playback.service.PlaybackService.$r8$lambda$7PiFXyh4IwtoTF_I1z1klF0yEqo(SourceFile:0)
	at de.danoeh.antennapod.playback.service.PlaybackService$$ExternalSyntheticLambda1.run(SourceFile:0)
	at java.lang.Thread.run(Thread.java:1012)

I also did two log recordings with logfox :
14_06-11-37-25_110.log.bin
14_06-11-38-56_992.log.bin

I’m running the same AntennaPod version and it continues to work well for me with zero crashes.

Assuming that all of your other apps are stable and you aren’t running low on storage the most straightforward approach would be to export the AntennaPod database, uninstall the app, reinstall the app, and import the database. (You could go through the process of troubleshooting exactly what’s going on with your current installation, but that’s probably not worth your time and trouble unless you enjoy that kind of challenge.)

1 Like

The crash is due to a NullPointerException when the app tries to update media metadata — looks like the MediaSessionCompat object isn’t initialized properly during playback. This might be a bug in version 3.8.0.

Try downgrading to version 3.7.x from GitHub, and disabling Bluetooth playback temporarily might help reduce crashes until it’s fixed.

1 Like

Thanks for you suggestion, I will try it next time but since the day I posted it’s working fine.

Thanks for having a look into the log. It’ weird but since the day I posted, I didn’t experience any more crashes. I don’t know what fixed it. I will try your suggestion it the crashed come back. Thanks again!