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

Could not instantiate image codec #46

Closed mbenci closed 4 years ago

mbenci commented 4 years ago

I'm using 0.19.0 version When I try to download this video https://drive.google.com/file/d/1K-ZKOHX48pkd4QZuB18TvpkfLUl4rr5T/view (I shared it in google drive so you can download it and try).

For other videos I have no problem.

════════ Exception caught by image resource service ════════════════════════════════════════════════ The following _Exception was thrown resolving an image codec: Exception: Could not instantiate image codec.

When the exception was thrown, this was the stack:

0 _futurize (dart:ui/painting.dart:4134:5)

1 instantiateImageCodec (dart:ui/painting.dart:1669:10)

2 PaintingBinding.instantiateImageCodec (package:flutter/src/painting/binding.dart:74:12)

3 FileImage._loadAsync (package:flutter/src/painting/image_provider.dart:545:43)

... Path: /storage/emulated/0/Download/b8687ac25945102ff373a0a50d3fbf6239ce5bb4c57784d02f700effb8579096 ════════════════════════════════════════════════════════════════════════════════════════════════════ [✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G87, locale it-IT) [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 10.3) [✓] Android Studio (version 3.5) [✓] IntelliJ IDEA Community Edition (version 2019.2.2) [✓] VS Code (version 1.37.1) [✓] Connected device (1 available) • No issues found!
ko2ic commented 4 years ago

@mbenci I tried with that file and it worked fine. I confirmed it with both iOS and android in the example of image_downloader.

ko2ic commented 4 years ago

Close it because it has been confirmed that it works without problems.

ishaileshmishra commented 4 years ago

Problem persists:

[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: type 'List' is not a subtype of type 'List'

0 Country.all. (package:rest_countries/models/allCountries.dart:33:11)

1 Webservice.load (package:rest_countries/webservice/webservice.dart:18:23)

#2 _CountriesState._populateNewsArticles (package:rest_countries/widgets/countryList.dart:26:18) #3 _CountriesState.initState (package:rest_countries/widgets/countryList.dart:35:5) #4 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4355:58) #5 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5) #6 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14) #7 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12) #8 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14) #9 Element.inflateWidget (package:flutter/src/widgets/framework.<…> ════════ Exception caught by image resource service ════════════════════════════════════════════════ The following _Exception was thrown resolving an image codec: Exception: Could not instantiate image codec. When the exception was thrown, this was the stack: #0 _futurize (dart:ui/painting.dart:4304:5) #1 instantiateImageCodec (dart:ui/painting.dart:1682:10) #2 PaintingBinding.instantiateImageCodec (package:flutter/src/painting/binding.dart:88:12) #3 NetworkImage._loadAsync (package:flutter/src/painting/_network_image_io.dart:104:20) ... Image provider: NetworkImage("https://restcountries.eu/data/arm.svg", scale: 1.0) Image key: NetworkImage("https://restcountries.eu/data/arm.svg", scale: 1.0) ════════════════════════════════════════════════════════════════════════════════════════════════════ ════════ (2) Exception caught by image resource service ════════════════════════════════════════════ Exception: Could not instantiate image codec. ════════════════════════════════════════════════════════════════════════════════════════════════════