-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Android Q 设备上query查询图片资源crash #646
Comments
AlbumLoader类做了Android Q的处理,代码如下: package com.zhihu.matisse.internal.loader; import android.content.Context; import androidx.loader.content.CursorLoader; import com.zhihu.matisse.internal.entity.Album; /**
|
encounter the same situation. looking for solution |
当使用兼容的AlbumLoader 之后,如果视频库没有文件,会出现以下错误: |
On Android Q,the projection parameter of ContentResolver.query() no longer support custom column like xxx AS xx,instead, it throws IllegalArgumentException because of the setting in MediaProvider.java : qb.setStrict(true).
In MediaProvider.java:
|
Android Q 设备上query查询图片资源crash
设备:Android Q模拟器
compileSdkVersion: 29
2019-08-15 17:10:37.338 W/System.err: java.lang.RuntimeException: An error occurred while executing doInBackground() 2019-08-15 17:10:37.338 W/System.err: at androidx.loader.content.ModernAsyncTask$3.done(ModernAsyncTask.java:164) 2019-08-15 17:10:37.338 W/System.err: at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) 2019-08-15 17:10:37.338 W/System.err: at java.util.concurrent.FutureTask.setException(FutureTask.java:252) 2019-08-15 17:10:37.338 W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:271) 2019-08-15 17:10:37.338 W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 2019-08-15 17:10:37.338 W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 2019-08-15 17:10:37.338 W/System.err: at java.lang.Thread.run(Thread.java:919) 2019-08-15 17:10:37.339 W/System.err: Caused by: java.lang.IllegalArgumentException: Invalid column COUNT(*) AS count 2019-08-15 17:10:37.339 W/System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:170) 2019-08-15 17:10:37.347 W/System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140) 2019-08-15 17:10:37.347 W/System.err: at android.content.ContentProviderProxy.query(ContentProviderNative.java:423) 2019-08-15 17:10:37.352 W/System.err: at android.content.ContentResolver.query(ContentResolver.java:944) 2019-08-15 17:10:37.355 W/System.err: at android.content.ContentResolver.query(ContentResolver.java:880) 2019-08-15 17:10:37.355 W/System.err: at androidx.core.content.ContentResolverCompat.query(ContentResolverCompat.java:81) 2019-08-15 17:10:37.355 W/System.err: at androidx.loader.content.CursorLoader.loadInBackground(CursorLoader.java:63) 2019-08-15 17:10:37.355 W/System.err: at com.zhihu.matisse.internal.loader.AlbumLoader.loadInBackground(AlbumLoader.java:98) 2019-08-15 17:10:37.356 W/System.err: at com.zhihu.matisse.internal.loader.AlbumLoader.loadInBackground(AlbumLoader.java:34) 2019-08-15 17:10:37.383 W/System.err: at androidx.loader.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307) 2019-08-15 17:10:37.384 W/System.err: at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60) 2019-08-15 17:10:37.384 W/System.err: at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48) 2019-08-15 17:10:37.384 W/System.err: at androidx.loader.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141) 2019-08-15 17:10:37.384 W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
The text was updated successfully, but these errors were encountered: