CliffracerMerchant/SoundAura

App crashes on adding a large number of media files

Closed this issue · 5 comments

When I went to add files to a playlist, it crashes after I press OK. Upon relaunching, the files were not added. The total number of files across playlists and tracks is above 60.

It would be greatly appreciated if the app could handle more music files.

If it helps: I once tried to add around 300 files into a playlist. That was the first time it crashed.

New problem: now I can't add more files anymore. It just crashes. Even if I remove previous files.

Sorry, I admit I kind of rushed the update out because I wanted to make the volume boost feature available, and I totally forgot to test things like adding a large number of files at once. I'll try to see if I can reproduce this and get it fixed quickly.

In the meantime, you might try long pressing the app icon to get to the system settings for the app, and clearing the app data on that screen. You'll have to re-add all of your files if you do this of course, but it should at least temporarily fix this crash whenever to try to add new files at all.

As for the long playlist, I'm not sure if this will work before I know what is causing the crash, but I would try:

  1. Add just the first five files you want in the playlist
  2. Tap the playlist's more options icon, then open up the 'playlist options' dialog
  3. Tap the add button in the 'playlist options' dialog
  4. Add five or so more tracks at a time to the playlist. The new track list isn't saved until you confirm the 'playlist options' dialog, so you'll have to confirm the dialog each time you add the new tracks, not just once after adding all of them five or however many at a time.

It might be that it isn't the number of files you're adding to the playlist that's causing the crash, but some specific file? I restricted the system file chooser to files with an audio mime type. I think these should all be playable through Android's built in MediaPlayer, but it could be that some file type that shows up in the system chooser isn't actually playable.

Thanks for looking into the issue!

As for the long playlist, I'm not sure if this will work before I know what is causing the crash, but I would try:

Adding files incrementally still causes a crash eventually. It works for a number of files at first, but starts crashing, eventually crashing even if only one file is selected. I'd hazard a guess and say it starts somewhere above 60 files, but I have not tested it extensively.

It might be that it isn't the number of files you're adding to the playlist that's causing the crash, but some specific file?

Might not be, as adding different music files still causes a crash.


Also, after clearing the app's data, it did work, even successfully adding files that failed before. However, the same issue appeared again when adding around 20 files after adding 3 playlists of 40, 26, and 25 files, as well as 6 individual tracks.

Well the good news is that this crash was very easy to fix. It was crashing due to the app attempting to display a popup message that used a string resource that I made a dumb formatting mistake in.

The bad news is that the popup message that was causing the crash was supposed to tell you that you've reached the file limit of (for Android versions < 11) 128. This is because I used scoped storage to avoid requiring the access all storage permission, and holding onto the permissions for the files that the user selects. Unfortunately Android only allows apps to have 512 persisted permissions this way, or 128 for Android versions < 11.

I'm going to close this issue since the crash is technically fixed, but I'm going to work on finding a way to increase the allowed file limit. Here is the issue I've created for this, in case you want to keep track of it.

Ah, I see. Thanks for your effort! I'll see the new issue you've filed.