Closed wildsurfer closed 4 years ago
Hi i am trying this plugin but when i try it in a physical device the application crash on run with this message (i use the same code that was published in pub.dev)
Performing hot reload... Syncing files to device MI 9... Reloaded 3 of 831 libraries in 591ms. I/flutter (28821): 2 I/flutter (28821): 0 E/AndroidRuntime(28821): FATAL EXCEPTION: AsyncTask #1 E/AndroidRuntime(28821): Process: dev.instagram.instagram_clone, PID: 28821 E/AndroidRuntime(28821): java.lang.RuntimeException: An error occurred while executing doInBackground() E/AndroidRuntime(28821): at android.os.AsyncTask$4.done(AsyncTask.java:399) E/AndroidRuntime(28821): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) E/AndroidRuntime(28821): at java.util.concurrent.FutureTask.setException(FutureTask.java:252) E/AndroidRuntime(28821): at java.util.concurrent.FutureTask.run(FutureTask.java:271) E/AndroidRuntime(28821): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289) E/AndroidRuntime(28821): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/AndroidRuntime(28821): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/AndroidRuntime(28821): at java.lang.Thread.run(Thread.java:919) E/AndroidRuntime(28821): Caused by: java.io.FileNotFoundException: Failed to create image decoder with message 'invalid input'Input contained an error. E/AndroidRuntime(28821): at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:149) E/AndroidRuntime(28821): at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:705) E/AndroidRuntime(28821): at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1702) E/AndroidRuntime(28821): at android.content.ContentResolver.openTypedAssetFile(ContentResolver.java:1607) E/AndroidRuntime(28821): at android.content.ContentResolver.lambda$loadThumbnail$0(ContentResolver.java:3617) E/AndroidRuntime(28821): at android.content.-$$Lambda$ContentResolver$7ILY1SWNxC2xhk-fQUG6tAXW9Ik.call(Unknown Source:10) E/AndroidRuntime(28821): at android.graphics.ImageDecoder$CallableSource.createImageDecoder(ImageDecoder.java:550) E/AndroidRuntime(28821): at android.graphics.ImageDecoder.decodeBitmapImpl(ImageDecoder.java:1847) E/AndroidRuntime(28821): at android.graphics.ImageDecoder.decodeBitmap(ImageDecoder.java:1840) E/AndroidRuntime(28821): at android.content.ContentResolver.loadThumbnail(ContentResolver.java:3616) E/AndroidRuntime(28821): at android.content.ContentResolver.loadThumbnail(ContentResolver.java:3600) E/AndroidRuntime(28821): at com.morbit.photogallery.PhotoGalleryPlugin.getImageThumbnail(PhotoGalleryPlugin.kt:404) E/AndroidRuntime(28821): at com.morbit.photogallery.PhotoGalleryPlugin.getAlbumThumbnail(PhotoGalleryPlugin.kt:468) E/AndroidRuntime(28821): at com.morbit.photogallery.PhotoGalleryPlugin.access$getAlbumThumbnail(PhotoGalleryPlugin.kt:22) E/AndroidRuntime(28821): at com.morbit.photogallery.PhotoGalleryPlugin$onMethodCall$9.invoke(PhotoGalleryPlugin.kt:127) E/AndroidRuntime(28821): at com.morbit.photogallery.PhotoGalleryPlugin$onMethodCall$9.invoke(PhotoGalleryPlugin.kt:22) E/AndroidRuntime(28821): at com.morbit.photogallery.BackgroundAsyncTask.doInBackground(PhotoGalleryPlugin.kt:615) E/AndroidRuntime(28821): at com.morbit.photogallery.BackgroundAsyncTask.doInBackground(PhotoGalleryPlugin.kt:609) E/AndroidRuntime(28821): at android.os.AsyncTask$3.call(AsyncTask.java:378) E/AndroidRuntime(28821): at java.util.concurrent.FutureTask.run(FutureTask.java:266) E/AndroidRuntime(28821): ... 4 more I/Process (28821): Sending signal. PID: 28821 SIG: 9 Lost connection to device.
@camilo1498, this looks like another issue. You may try to run example app from this repository and if it’s not working with the same error you may create new issue.
Have fixed this bug in the latest version. Check it here. Hopefully it solve your problem.
Works for me! Thanks!
Steps to reproduce:
MediumType.photo
withMediumType.video
Instead of seeing a list of video thumbnails app crashes with a message very close to one I described in https://github.com/Firelands128/photo_gallery/issues/2
I was able to debug it a bit in Android Studio and it looks like the problem is here: https://github.com/Firelands128/photo_gallery/blob/181d2ce10d4103415a63b49c5771769a5cf17202/android/src/main/kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt#L385-L398
mediumType is null when you're trying to list videos and it fails in line 394