Skip to content
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

Crash : Can't create sort clause without columns #378

Open
pingothedoer opened this issue Aug 8, 2021 · 5 comments
Open

Crash : Can't create sort clause without columns #378

pingothedoer opened this issue Aug 8, 2021 · 5 comments
Labels

Comments

@pingothedoer
Copy link

Expected Behavior

ImagePicker should have open the gallery

Actual Behavior

App crashed with the following exception

java.lang.IllegalArgumentException: Can't create sort clause without columns. at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:170) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140) at android.content.ContentProviderProxy.query(ContentProviderNative.java:423) at android.content.ContentResolver.query(ContentResolver.java:946) at com.esafirm.imagepicker.features.fileloader.DefaultImageFileLoader$ImageLoadRunnable.queryData(DefaultImageFileLoader.kt:118) at com.esafirm.imagepicker.features.fileloader.DefaultImageFileLoader$ImageLoadRunnable.queryData$default(DefaultImageFileLoader.kt:83) at com.esafirm.imagepicker.features.fileloader.DefaultImageFileLoader$ImageLoadRunnable.run(DefaultImageFileLoader.kt:206) 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:919)

Steps to Reproduce the Problem

  1. Launch photoLauncher.launch(ImagePickerConfig())
  2. App crashes

Saw the same issue, but it was closed. I don't know whether the update has been published or not.

Specifications

  • Image Picker Version: 3.0.0-beta4
  • Android OS: 10
  • Phone: Nokia 7.2
@cikichen
Copy link

cikichen commented Sep 2, 2021

+1,me too

@fredrickreuben
Copy link

I am still experiencing this.

@felipecs81
Copy link

The issue still exists.
Library version: 3.0.0-beta4
Android version 10.0

@esafirm esafirm added the bug label May 14, 2022
@esafirm esafirm added triage and removed bug labels Nov 20, 2022
@esafirm
Copy link
Owner

esafirm commented Nov 20, 2022

Can you check if the issue is still there in 3.0.0

@ronenfe
Copy link

ronenfe commented Apr 14, 2024

That's where it happens. I have the same problem in my app:

            if (useNewApi) {
                val args = Bundle().apply {
                    // Sort function
                    putStringArray(
                        ContentResolver.QUERY_ARG_SORT_COLUMNS,
                        arrayOf(MediaStore.Files.FileColumns.DATE_MODIFIED)
                    )
                    putInt(
                        ContentResolver.QUERY_ARG_SORT_DIRECTION,
                        ContentResolver.QUERY_SORT_DIRECTION_DESCENDING
                    )
                    // Selection
                    putString(
                        ContentResolver.QUERY_ARG_SQL_SELECTION,
                        selection
                    )
                    // Limit
                    if (limit != null) {
                        putInt(ContentResolver.QUERY_ARG_LIMIT, limit)
                    }
                }

                return context.contentResolver.query(sourceUri, projection, args, null)
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants