Closed BryceStevenWilley closed 8 years ago
Here is the stack dump, just in case we need it later. Looks like a relatively simple fix.
01-19 00:42:59.836 3257-3257/com.example.karenlee.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.karenlee.app, PID: 3257
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.karenlee.app/com.example.karenlee.app.SetupActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=3257, uid=10057 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=3257, uid=10057 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1599)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
at android.content.ContentResolver.query(ContentResolver.java:491)
at android.content.ContentResolver.query(ContentResolver.java:434)
at com.example.karenlee.app.SetupActivity.getSongList(SetupActivity.java:82)
at com.example.karenlee.app.SetupActivity.onCreate(SetupActivity.java:36)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Made some progress with my latest commit, but as it states in the commit, the app now doesn't show dialogues when it should, and the system never seems to call the onPermissionRequestResult method, meaning that the app doesn't work for the current session, although it will work fine once the user has restarted the app. Leaving this issue open until those two issues are fixed.
With commit 8b0f588, this should be fixed. UI flow should ask the user to allow access, informing them why we need it if need be, and then telling them that we can't do anything if we still don't have access. Closing this issue until I can test on a real device.
Don't have the specific info on me, but I started the app on an emulator running Marshmellow, and it crashed on startup. The issue ended up being something relation to Runtime permissions: some resources on it are here. Should fix soon.