zhihu / Matisse

:fireworks: A well-designed local image and video selector for Android
Apache License 2.0
12.52k stars 2.06k forks source link

android 9出现崩溃 #672

Open erichyx opened 5 years ago

erichyx commented 5 years ago

在Android 9系统下出现如下异常,使用前读写权限已经动态申请过了。

image


    at androidx.loader.content.ModernAsyncTask$3.done(ModernAsyncTask.java:33)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
    at java.util.concurrent.FutureTask.run(FutureTask.java:271)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/file from pid=15353, uid=10290 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
    at android.os.Parcel.createException(Parcel.java:1953)
    at android.os.Parcel.readException(Parcel.java:1921)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
    at android.content.ContentProviderProxy.query(ContentProviderProxy.java:418)
    at android.content.ContentResolver.query(ContentResolver.java:804)
    at android.content.ContentResolver.query(ContentResolver.java:753)
    at androidx.core.content.ContentResolverCompat.a(ContentResolverCompat.java:25)
    at androidx.loader.content.CursorLoader.y(CursorLoader.java:36)
    at com.zhihu.matisse.internal.loader.AlbumLoader.y(AlbumLoader.java:0)
    at com.zhihu.matisse.internal.loader.AlbumLoader.y(AlbumLoader.java:0)
    at androidx.loader.content.AsyncTaskLoader.z(AsyncTaskLoader.java:0)
    at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    at androidx.loader.content.ModernAsyncTask$2.call(ModernAsyncTask.java:18)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    ... 3 more
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/file from pid=15353, uid=10290 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
    at android.os.Parcel.createException(Parcel.java:1953)
    at android.os.Parcel.readException(Parcel.java:1921)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
    at android.content.ContentProviderProxy.query(ContentProviderProxy.java:418)
    at android.content.ContentResolver.query(ContentResolver.java:804)
    at android.content.ContentResolver.query(ContentResolver.java:753)
    at androidx.core.content.ContentResolverCompat.a(ContentResolverCompat.java:25)
    at androidx.loader.content.CursorLoader.y(CursorLoader.java:36)
    at com.zhihu.matisse.internal.loader.AlbumLoader.y(AlbumLoader.java:0)
    at com.zhihu.matisse.internal.loader.AlbumLoader.y(AlbumLoader.java:0)
    at androidx.loader.content.AsyncTaskLoader.z(AsyncTaskLoader.java:0)
    at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    at androidx.loader.content.ModernAsyncTask$2.call(ModernAsyncTask.java:18)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)```
timfei commented 4 years ago

你好,请问解决了吗?我遇到了类似问题,因为项目暂时无法升级到 Android X,也是相机/读写都有权限了,但是 bug 统计平台还是统计到了很多 Camera 权限的问题

erichyx commented 4 years ago

@timfei 没解决,不过最近好像没出现这个错误了。