flutter_gif icon indicating copy to clipboard operation
flutter_gif copied to clipboard

Flutter 3.16.9: The method 'instantiateImageCodec' isn't defined for the class 'PaintingBinding'.

Open andrejvujic opened this issue 1 year ago • 4 comments

I recently upgraded Flutter to version 3.16.9, I'm on the stable channel. When I try to run my app which depends on flutter_gif version 0.0.4 and worked fine before updating Flutter, I get an error:

Launching lib/main.dart on sdk gwear arm64 in debug mode...
../../../.pub-cache/hosted/pub.dev/flutter_gif-0.0.4/lib/flutter_gif.dart:236:8: Error: The method 'instantiateImageCodec' isn't defined for the class 'PaintingBinding'.
 - 'PaintingBinding' is from 'package:flutter/src/painting/binding.dart' ('../../../xxxxx/Flutter/sdk/packages/flutter/lib/src/painting/binding.dart').
Try correcting the name to the name of an existing method, or defining a method named 'instantiateImageCodec'.
      .instantiateImageCodec(data.buffer.asUint8List());
       ^^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script '/xxxxx/Flutter/sdk/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 1350

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/xxxxx/Flutter/sdk/bin/flutter'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
Exception: Gradle task assembleDebug failed with exit code 1

Exited (1).

flutter doctor -v output:

andrej@Andrejs-MacBook-Pro ~ % flutter doctor -v
[✓] Flutter (Channel stable, 3.16.9, on macOS 13.6 22G120 darwin-arm64, locale
    en-BA)
    • Flutter version 3.16.9 on channel stable at
      /Users/andrej/Documents/Flutter/sdk
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 41456452f2 (9 days ago), 2024-01-25 10:06:23 -0800
    • Engine revision f40e976bed
    • Dart version 3.2.6
    • DevTools version 2.28.5

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/andrej/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • 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
      17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.86.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.82.0

[✓] Connected device (3 available)
    • sdk gwear arm64 (mobile) • emulator-5554 • android-arm64  • Android 11
      (API 30) (emulator)
    • macOS (desktop)          • macos         • darwin-arm64   • macOS 13.6
      22G120 darwin-arm64
    • Chrome (web)             • chrome        • web-javascript • Google Chrome
      119.0.6045.123

[✓] Network resources
    • All expected network resources are available.

• No issues found!

andrejvujic avatar Feb 03 '24 10:02 andrejvujic