Closed C9Glax closed 9 months ago
Hi @C9Glax, would you try this .apk? The crash should have been fixed with one of the latest commits, but I don't remember if I fixed it before or after the apk I sent you last time.
Sadly not fixed.
type: crash
osVersion: google/oriole/oriole:13/TQ3A.230805.001/2023090600:user/release-keys
package: com.cappielloantonio.tempo:20
process: com.cappielloantonio.tempo
processUptime: 2591 + 161 ms
installer: com.android.packageinstaller
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.get(ArrayList.java:437)
at com.cappielloantonio.tempo.util.ReplayGainUtil.setTrackReplayGain(ReplayGainUtil.java:146)
at com.cappielloantonio.tempo.util.ReplayGainUtil.applyReplayGain(ReplayGainUtil.java:117)
at com.cappielloantonio.tempo.util.ReplayGainUtil.setReplayGain(ReplayGainUtil.java:28)
at com.cappielloantonio.tempo.service.MediaService$initializePlayerListener$1.onTracksChanged(MediaService.kt:252)
at androidx.media3.exoplayer.ExoPlayerImpl.lambda$updatePlaybackInfo$17(ExoPlayerImpl.java:2062)
at androidx.media3.exoplayer.ExoPlayerImpl$$ExternalSyntheticLambda3.invoke(Unknown Source:4)
at androidx.media3.common.util.ListenerSet$ListenerHolder.invoke(ListenerSet.java:339)
at androidx.media3.common.util.ListenerSet.lambda$queueEvent$0(ListenerSet.java:223)
at androidx.media3.common.util.ListenerSet$$ExternalSyntheticLambda1.run(Unknown Source:6)
at androidx.media3.common.util.ListenerSet.flushEvents(ListenerSet.java:245)
at androidx.media3.exoplayer.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:2116)
at androidx.media3.exoplayer.ExoPlayerImpl.handlePlaybackInfo(ExoPlayerImpl.java:1949)
at androidx.media3.exoplayer.ExoPlayerImpl.lambda$new$1$androidx-media3-exoplayer-ExoPlayerImpl(ExoPlayerImpl.java:331)
at androidx.media3.exoplayer.ExoPlayerImpl$$ExternalSyntheticLambda15.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7940)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
Okay some basic code-review leads me to believe the problem to be some odd beavhiour of java-lists?
https://github.com/CappielloAntonio/tempo/blob/main/app/src/main/java/com/cappielloantonio/tempo/util/ReplayGainUtil.java#L50
List<ReplayGain> gains = new ArrayList<>();
Don't you need to add ReplayGain
to the call for ArrayList as well?
List<ReplayGain> gains = new ArrayList<ReplayGain>();
Because other than that I have no logical explanation why the exception would say that the List-size is 0, when clearly you are adding two elements if that would be the case.
Okay some basic code-review leads me to believe the problem to be some odd beavhiour of java-lists? https://github.com/CappielloAntonio/tempo/blob/main/app/src/main/java/com/cappielloantonio/tempo/util/ReplayGainUtil.java#L50
List<ReplayGain> gains = new ArrayList<>();
Don't you need to add
ReplayGain
to the call for ArrayList as well?List<ReplayGain> gains = new ArrayList<ReplayGain>();
Because other than that I have no logical explanation why the exception would say that the List-size is 0, when clearly you are adding two elements if that would be the case.
That is definitely not the case.
I've tried to replicate this issue with the latest commit, but I were unsuccessful. Could you please provide more information when this happens? How many songs are you playing? Do they have album/track gain?
So no easy fix :(
I am playing my playlist (should be 30-40 songs). Most of my files are flac or wav, and as far as I know the ones that cause the crash do not have gain. Is there any way to check?
Would you try this .apk again please? I don't understand how it can raise an IndexOutOfBoundsException if it's already been a few days since I force the gains array to always have the elements I need.
Alternatively I would ask you to temporarily send me the file that crashes the app or, at most, grant me access to your server with a demo user in order to debug more deeply.
since I force the gains array to always have the elements I need
Because other than that I have no logical explanation why the exception would say that the List-size is 0, when clearly you are adding two elements if that would be the case.
My point exactly 🤔
Would you try this .apk again please?
Seems to be fixed. At least it doesn't crash on that playlist anymore.
Closing, I will ping you should it happen again.
Replay gain on auto