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 113 forks source link

com.ko2ic.imagedownloader.ImageDownloaderPlugin$CallbackImpl$granted$3.invoke #130

Open theatifwaheed opened 1 year ago

erhacorpdotcom2022 commented 1 year ago

Hi. I got same error

Note: Recompile with -Xlint:deprecation for details. e: file:///Users/rullyhasibuan/.pub-cache/hosted/pub.dev/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

FAILURE: Build failed with an exception.

erhacorpdotcom2022 commented 1 year ago

My app/build.gradle

buildscript { ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() }

dependencies {
    classpath 'com.android.tools.build:gradle:7.2.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.13'
}

}

almogtovim commented 1 year ago

Same issue!

  1. flutter doctor -v
    [✓] Flutter (Channel stable, 3.10.0, on macOS 13.3.1 22E772610a darwin-arm64, locale en-IL) • Flutter version 3.10.0 on channel stable at /Users/almogtovim/Development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 84a1e904f4 (5 days ago), 2023-05-09 07:41:44 -0700 • Engine revision d44b5a94c9 • Dart version 3.0.0 • DevTools version 2.23.1 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) • Android SDK at /Users/almogtovim/Library/Android/sdk • Platform android-33, build-tools 33.0.0 • ANDROID_HOME = /Users/almogtovim/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 • CocoaPods version 1.12.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) [✓] VS Code (version 1.78.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.64.0 [✓] Connected device (3 available) • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 32) (emulator) • macOS (desktop) • macos • darwin-arm64 • macOS 13.3.1 22E772610a darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 113.0.5672.92 [✓] Network resources • All expected network resources are available.
  2. build.gradle buildscript { ext.kotlin_version = '1.8.21' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.2.0' classpath 'com.google.gms:google-services:4.3.13' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } }
QiPg commented 1 year ago

I upgraded my flutter to 3.10.0 and found the same problem. I removed image_downloader and used image_gallery_saver instead, the project runs normally.

logispire commented 1 year ago

I am also getting the same issue, @ko2ic, please look into this on an urgent basis, this issue is breaking the entire working app

larakreisz commented 1 year ago

Has anyone found a solution for that problem?

inkersgithub commented 10 months ago

There is already a branch that has fixed this issue and is waiting to get merged - https://github.com/ko2ic/image_downloader/pull/143

I used his forked repo and is working fine. Thanks @VikasTailorbird Use it in pubspec.yaml as below image_downloader: git: url: https://github.com/VikasTailorbird/image_downloade

Maarten0110 commented 10 months ago

There is already a branch that has fixed this issue and is waiting to get merged - #143

I used his forked repo and is working fine. Thanks @VikasTailorbird Use it in pubspec.yaml as below image_downloader: git: url: https://github.com/VikasTailorbird/image_downloade

Hi @inkersgithub, thanks for the suggestion. I think there is an 'r' missing from the github url. I tried adding this to my pubspec.yaml file, like this:

dependencies:
     .
     .
     .
  image_downloader: git: url: https://github.com/VikasTailorbird/image_downloader
     .
     .
     .

But I get the following error when I run pubspec.yaml:

Error on line 36, column 24: Mapping values are not allowed here. Did you miss a colon earlier?
   ╷
36 │   image_downloader: git: url: https://github.com/VikasTailorbird/image_downloader
   │                        ^
   ╵
Please correct the pubspec.yaml file at <redacted>/pubspec.yaml

What does your yaml entry for image_downloader look like exactly? Am I doing something wrong?


UPDATE

Nevermind I figured it out, should be formatted like this:

dependencies:
  image_downloader:
    git:
      url: https://github.com/VikasTailorbird/image_downloader

The solution worked for me btw, thanks @inkersgithub and @VikasTailorbird