ko2ic / image_downloader

Flutter plugin that downloads images and movies on the Internet and saves to Photo Library on iOS or specified directory on Android.
https://pub.dartlang.org/packages/image_downloader#-readme-tab-
MIT License
92 stars 119 forks source link

Build failed in 0.31.0 #116

Open khoadng opened 2 years ago

khoadng commented 2 years ago

I can't build the app, could you take a look at this error?

V:\Env\flutter\.pub-cache\hosted\pub.dartlang.org\image_downloader-0.31.0\android\src\main\kotlin\com\ko2ic\imagedownloader\ImageDownloaderPlugin.kt: (332, 17): 'when' expression must be exhaustive, add necessary 'is Pending', 'is Successful' branches or 'else' branch instead
ttl41 commented 2 years ago

Same issue here!

Fairfieldfred commented 2 years ago

Same problem when using Kotlin 1.7.10

go to android/build.gradle and change ext.kotlin_version = '1.7.10' to ext.kotlin_version = '1.6.10'

This fixed it for me.

appcapsergen commented 1 year ago

Same here

e: ~/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/image_downloader-0.31.0/android/src/main/kotlin/com/ko2ic/imagedownloader/ImageDownloaderPlugin.kt: (332, 17): 'when' expression must be exhaustive, add necessary 'is Pending', 'is Successful' branches or 'else' branch instead
appcapsergen commented 1 year ago

The work-around by @Fairfieldfred works, even when the kotlin version is set to 1.6.21 (in my case), but the missing when branches should still be added!