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

App crashes on Android 11 - SDK 30 (Invalid token LIMIT in getCollectionThumbnail) #28

Open
AdrianSima opened this issue Mar 25, 2021 · 3 comments

Comments

@AdrianSima
Copy link

After settings compiledSdkVersion to 30 the app crashes every time I try to get collections or medias.

E/AndroidRuntime( 6991): 	at android.os.AsyncTask$4.done(AsyncTask.java:415)
E/AndroidRuntime( 6991): 	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime( 6991): 	at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime( 6991): 	at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime( 6991): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
E/AndroidRuntime( 6991): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime( 6991): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime( 6991): 	at java.lang.Thread.run(Thread.java:923)
E/AndroidRuntime( 6991): Caused by: java.lang.IllegalArgumentException: Invalid token LIMIT
E/AndroidRuntime( 6991): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
E/AndroidRuntime( 6991): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
E/AndroidRuntime( 6991): 	at android.content.ContentProviderProxy.query(ContentProviderNative.java:472)
E/AndroidRuntime( 6991): 	at android.content.ContentResolver.query(ContentResolver.java:1183)
E/AndroidRuntime( 6991): 	at android.content.ContentResolver.query(ContentResolver.java:1115)
E/AndroidRuntime( 6991): 	at android.content.ContentResolver.query(ContentResolver.java:1071)
E/AndroidRuntime( 6991): 	at com.example.media_gallery.MediaGalleryPlugin.getCollectionThumbnail(MediaGalleryPlugin.kt:427)
E/AndroidRuntime( 6991): 	at com.example.media_gallery.MediaGalleryPlugin.access$getCollectionThumbnail(MediaGalleryPlugin.kt:20)
E/AndroidRuntime( 6991): 	at com.example.media_gallery.MediaGalleryPlugin$onMethodCall$7.invoke(MediaGalleryPlugin.kt:92)
E/AndroidRuntime( 6991): 	at com.example.media_gallery.MediaGalleryPlugin$onMethodCall$7.invoke(MediaGalleryPlugin.kt:20)
E/AndroidRuntime( 6991): 	at com.example.media_gallery.doAsync.doInBackground(MediaGalleryPlugin.kt:538)
E/AndroidRuntime( 6991): 	at com.example.media_gallery.doAsync.doInBackground(MediaGalleryPlugin.kt:532)
E/AndroidRuntime( 6991): 	at android.os.AsyncTask$3.call(AsyncTask.java:394)
E/AndroidRuntime( 6991): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime( 6991): 	... 4 more
Lost connection to device.

The error seems to be in the getCollectionThumbnail() function with: "Invalid token LIMIT".

Tested this on Android Emulator with Pixel 4XL API 30 and media_gallery: 0.1.5.

@AdrianSima AdrianSima changed the title App crashes on Android 11 - SDK 30 App crashes on Android 11 - SDK 30 (Invalid token LIMIT in getCollectionThumbnail) Mar 25, 2021
@AdrianSima
Copy link
Author

AdrianSima commented Mar 25, 2021

It works fine now after using this fork by @miyura https://github.com/Geostry/media_gallery
by changing this in pubspec.yaml:

dependencies:
    media_gallery:
        git:
          url: git://github.com/Geostry/media_gallery.git

@Ahmadre
Copy link

Ahmadre commented May 28, 2021

@aloisdeniel can we merge the fixes?

@benwinding
Copy link

Thanks @AdrianSima !

The only thing I would add, is that it's much safer to use the exact commit on the git repo, as the current master branch is broken. I use the following code:

  media_gallery:
    # Fixes issue: https://github.com/aloisdeniel/media_gallery/issues/28
    git:
      url: git://github.com/Geostry/media_gallery
      ref: f5b30c7298f01dcc1589b6ac450888010c0da9f3

That way future updates, to these forks, won't break the app

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

No branches or pull requests

3 participants