Iamsdt / MusicPlayer

A complete music player with playlist options. In this project the UI of old universal music player is used, but the layout created with new component of android like constrain layout, card view. For this project, exoplayer is for music play. This app support latest android 10.
Apache License 2.0
18 stars 4 forks source link

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

Open theoklink opened 4 years ago

theoklink commented 4 years ago

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 commented 3 years ago

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

BilalAsif25 commented 3 years ago

@theoklink have you managed to resolve it bro ?

theoklink commented 3 years ago

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

Iamsdt commented 3 years ago

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 commented 3 years ago

Yes, my post from a while back. Still no further forward

On Thu, 8 Oct 2020, 14:11 Shudipto Trafder, notifications@github.com wrote:

I agree with you @theoklink https://github.com/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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Iamsdt/MusicPlayer/issues/1#issuecomment-705558003, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKVRBXMKIUUEBMORBXDHHLSJW3B3ANCNFSM4O2NWDOQ .

theoklink commented 3 years ago

No, still stuck. It is ok when there is no sdcard. Tracks on sdcard have no permissions

On Thu, 8 Oct 2020, 14:00 Muhammad Bilal Asif, notifications@github.com wrote:

@theoklink https://github.com/theoklink have you managed to resolve it bro ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Iamsdt/MusicPlayer/issues/1#issuecomment-705551307, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKVRBUR6PVQATGUXV2EOSDSJWZYLANCNFSM4O2NWDOQ .

Iamsdt commented 3 years ago

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