Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a playlist when music is on external sdcard due to insufficient permissions #1

Open
theoklink opened this issue Jul 15, 2020 · 7 comments

Comments

@theoklink
Copy link

theoklink commented Jul 15, 2020

As the title explains, the insertion into a playlist fails for android 10 and above
2020-07-15 12:10:05.532 7977-8060/com.iamsdt.musicplayer E/UCEHandler: App crashed, executing UCEHandler's UncaughtExceptionHandler
java.lang.SecurityException: com.iamsdt.musicplayer has no access to content://media/external_primary/audio/media/19312
at android.os.Parcel.createException(Parcel.java:2087)
at android.os.Parcel.readException(Parcel.java:2055)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
at android.content.ContentProviderProxy.bulkInsert(ContentProviderNative.java:503)
at android.content.ContentResolver.bulkInsert(ContentResolver.java:1996)
at com.example.musicplayer.data.repo.PlaylistRepository.addToPlaylist(PlaylistRepo.kt:103)
at com.example.musicplayer.ui.songs.SongVM$addToPlaylist$1.invokeSuspend(SongVM.kt:72)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
2020-07-15 12:10:05.570 7977-8060/com.iamsdt.musicplayer I/Process: Sending signal. PID: 7977 SIG: 9

@BilalAsif25
Copy link

same issue, can you please do something about it @Iamsdt

@BilalAsif25
Copy link

@theoklink have you managed to resolve it bro ?

@theoklink
Copy link
Author

Android 10 is already a nightmare but android 11 even more so.

@Iamsdt
Copy link
Owner

Iamsdt commented Oct 8, 2020

I agree with you @theoklink. Doc suggests, use this

android:requestLegacyExternalStorage="true"

But this already added into AndroidManifest.xml

I found a stack overflow question, you can take a look
https://stackoverflow.com/questions/57398381/api-29-mediastore-access

@theoklink
Copy link
Author

theoklink commented Oct 8, 2020 via email

@theoklink
Copy link
Author

theoklink commented Oct 8, 2020 via email

@Iamsdt
Copy link
Owner

Iamsdt commented Oct 8, 2020

Yeah, external storage creates this issue.
If you figure the solution, please open a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants