Android Crash when connecting to server or playing local book #470

Open
opened 2026-04-24 23:24:45 +02:00 by adam · 8 comments
Owner

Originally created by @youngcw on GitHub (Feb 26, 2023).

After opening the Android app, the app will crash once it has connected to the local server. If I turn off internet it will crash when trying to play a book downloaded locally. I reinstalled the app and nothing changed. Last time I used the app was the 18th and everything was working. It looks like there was an update on the 19th so that may be what caused the issues.

Phone: Samsung S10e
Android 10

Originally created by @youngcw on GitHub (Feb 26, 2023). After opening the Android app, the app will crash once it has connected to the local server. If I turn off internet it will crash when trying to play a book downloaded locally. I reinstalled the app and nothing changed. Last time I used the app was the 18th and everything was working. It looks like there was an update on the 19th so that may be what caused the issues. Phone: Samsung S10e Android 10
adam added the android label 2026-04-24 23:24:45 +02:00
Author
Owner

@moverperfect commented on GitHub (Feb 27, 2023):

I believe that I am getting this same issue, I have created a bug report and narrowed it down to this.

java.lang.SecurityException: Permission Denial: reading com.android.externalstorage.ExternalStorageProvider uri content://com.android.externalstorage.documents/tree/primary%3AAudiobooks/document/primary%3AAudiobooks%2FDavid%20Goggins%2FCan't%20Hurt%20Me%2Fcover-li_lbtz6wmeppynr7c7hg.jpg from pid=31305, uid=10469 requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs

Full logs in txt file

I checked the permissions for the app and it has storage permissions.

audiobookshelf_error.txt

@moverperfect commented on GitHub (Feb 27, 2023): I believe that I am getting this same issue, I have created a bug report and narrowed it down to this. `java.lang.SecurityException: Permission Denial: reading com.android.externalstorage.ExternalStorageProvider uri content://com.android.externalstorage.documents/tree/primary%3AAudiobooks/document/primary%3AAudiobooks%2FDavid%20Goggins%2FCan't%20Hurt%20Me%2Fcover-li_lbtz6wmeppynr7c7hg.jpg from pid=31305, uid=10469 requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs` Full logs in txt file I checked the permissions for the app and it has storage permissions. [audiobookshelf_error.txt](https://github.com/advplyr/audiobookshelf-app/files/10834992/audiobookshelf_error.txt)
Author
Owner

@advplyr commented on GitHub (Feb 27, 2023):

Can you try closing the app, deleting the book from the file system, then re-open app and download the book again?

@advplyr commented on GitHub (Feb 27, 2023): Can you try closing the app, deleting the book from the file system, then re-open app and download the book again?
Author
Owner

@youngcw commented on GitHub (Feb 27, 2023):

I tried adding a new folder for local media and re-added my existing "audiobookshelf" folder instead. I gave it permissions again and everything is working again. I could open the app like normal and access my remote books, and local just fine.

I had noticed on a previous occasion that the app had lost access to the local media folder. That time the app didn't crash, I think I just deleted the local folder, re-setup the local folder, and downloaded the book again. I don't know why the app keeps loosing permissions to access the local folder.

@youngcw commented on GitHub (Feb 27, 2023): I tried adding a new folder for local media and re-added my existing "audiobookshelf" folder instead. I gave it permissions again and everything is working again. I could open the app like normal and access my remote books, and local just fine. I had noticed on a previous occasion that the app had lost access to the local media folder. That time the app didn't crash, I think I just deleted the local folder, re-setup the local folder, and downloaded the book again. I don't know why the app keeps loosing permissions to access the local folder.
Author
Owner

@moverperfect commented on GitHub (Mar 4, 2023):

To fix this, I deleted the files from the file system and the folder in the app. Then recreated it all and redownloaded and it is now working. Just deleting the book did not work, I had to recreate the library in the app.

@moverperfect commented on GitHub (Mar 4, 2023): To fix this, I deleted the files from the file system and the folder in the app. Then recreated it all and redownloaded and it is now working. Just deleting the book did not work, I had to recreate the library in the app.
Author
Owner

@robsutherland commented on GitHub (Mar 10, 2023):

I have been encountering this as well. In my case I have had to clear data for the app completely and reconnect to the server to get it to work again. It can't even get to the point of clicking play. Happens as soon as it tries to load the app with a half played local book on it.

@robsutherland commented on GitHub (Mar 10, 2023): I have been encountering this as well. In my case I have had to clear data for the app completely and reconnect to the server to get it to work again. It can't even get to the point of clicking play. Happens as soon as it tries to load the app with a half played local book on it.
Author
Owner

@ChrisKolan commented on GitHub (Apr 6, 2023):

I can confirm this error. Everything works fine after installation of the application. However, when you switch off the phone and switch it on again the application shows "Permission Denial" and cannot read/write to the local storage folder.

@ChrisKolan commented on GitHub (Apr 6, 2023): I can confirm this error. Everything works fine after installation of the application. However, when you switch off the phone and switch it on again the application shows "Permission Denial" and cannot read/write to the local storage folder.
Author
Owner

@advplyr commented on GitHub (Apr 6, 2023):

This is specific to Android 10 and below. It has to do with the device removing folder permissions then the app trying to access the local file. I'm not sure how to persist permissions on Android 10 and below yet.

@advplyr commented on GitHub (Apr 6, 2023): This is specific to Android 10 and below. It has to do with the device removing folder permissions then the app trying to access the local file. I'm not sure how to persist permissions on Android 10 and below yet.
Author
Owner

@tekgeek1205 commented on GitHub (Apr 27, 2023):

There is a permission bug when using googles data migration to a new phone. I just went from a Pixel 3a to a Pixel 7 and it acted like described above. Deleting the "old" library folder and creating a new library fixed the crash. I checked permissions before deleting anything "Music and Audio", "Notifications", and "Photos and Videos" were in the allowed section, and "No Permissions denied" in the Not Allow list.

Maybe a UUID mismatch between the phones or the jump from eMMC to UFS. IDK I'm just guessing at this point.

@tekgeek1205 commented on GitHub (Apr 27, 2023): There is a permission bug when using googles data migration to a new phone. I just went from a Pixel 3a to a Pixel 7 and it acted like described above. Deleting the "old" library folder and creating a new library fixed the crash. I checked permissions before deleting anything "Music and Audio", "Notifications", and "Photos and Videos" were in the allowed section, and "No Permissions denied" in the Not Allow list. Maybe a UUID mismatch between the phones or the jump from eMMC to UFS. IDK I'm just guessing at this point.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#470