cinder92 / react-native-get-music-files

React Native package to get music files from local and sd for iOS and Android
MIT License
130 stars 64 forks source link

App crashes with SecurityException: Permission Denial #35

Closed clems36 closed 5 years ago

clems36 commented 5 years ago

Hi! I just installed this package, launched my app and it crashed with the following adb logcat output:

java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=12207, uid=10095 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
        at android.os.Parcel.readException(Parcel.java:1959)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
        at android.content.ContentProviderProxy.query(ContentProviderNative.java:418)
        at android.content.ContentResolver.query(ContentResolver.java:760)
        at android.content.ContentResolver.query(ContentResolver.java:710)
        at android.content.ContentResolver.query(ContentResolver.java:668)
        at com.reactlibrary.RNReactNativeGetMusicFilesModule$1.run(RNReactNativeGetMusicFilesModule.java:133)
        at java.lang.Thread.run(Thread.java:764)

I added both android.permission.READ_EXTERNAL_STORAGE & android.permission.WRITE_EXTERNAL_STORAGE to my react-native project's AndroidManifest and the code inside componentDidMount is the same as the example in this repo.

Can anyone help ?

cinder92 commented 5 years ago

Hi, sorry for delay, you neet to ask for permissions with React Native Permissions

cinder92 commented 5 years ago

closing due to no response

clems36 commented 5 years ago

Sorry for the delay as well. That was it, my bad...