Rageh Azzazy
Rageh Azzazy

Reputation: 757

Awesome notification V0.7.1 fails to build

I'm having this problem, and ran out of options, I tried all solutions mentioned in below link but with no success

how to solve Execution failed for task ':app:compileFlutterBuildDebug'

/C:/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/awesome_notifications-0.7.1/lib/src/utils/resource_image_provider.dart:41:26: Error: Type 'DecoderBufferCallback' not found.
      ResourceImage key, DecoderBufferCallback decode) {
                         ^^^^^^^^^^^^^^^^^^^^^
/C:/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/awesome_notifications-0.7.1/lib/src/utils/resource_image_provider.dart:49:26: Error: Type 'DecoderBufferCallback' not found.
      ResourceImage key, DecoderBufferCallback decode) async {
                         ^^^^^^^^^^^^^^^^^^^^^
/C:/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/awesome_notifications-0.7.1/lib/src/utils/resource_image_provider.dart:22:7: Error: The non-abstract class 'ResourceImage' is missing implementations for these members:
 - ImageProvider.load
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class ResourceImage extends ImageProvider<ResourceImage> {
      ^^^^^^^^^^^^^
/C:/flutter/flutter/packages/flutter/lib/src/painting/image_provider.dart:567:24: Context: 'ImageProvider.load' is defined here.
  ImageStreamCompleter load(T key, DecoderCallback decode);
                       ^^^^
/C:/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/awesome_notifications-0.7.1/lib/src/utils/resource_image_provider.dart:41:26: Error: 'DecoderBufferCallback' isn't a type.
      ResourceImage key, DecoderBufferCallback decode) {
                         ^^^^^^^^^^^^^^^^^^^^^
/C:/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/awesome_notifications-0.7.1/lib/src/utils/resource_image_provider.dart:49:26: Error: 'DecoderBufferCallback' isn't a type.
      ResourceImage key, DecoderBufferCallback decode) async {
                         ^^^^^^^^^^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\flutter\flutter\bin\flutter.bat'' 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 32s
Exception: Gradle task assembleDebug failed with exit code 1

Upvotes: 2

Views: 2459

Answers (2)

Xavier Soh
Xavier Soh

Reputation: 165

I faced this issue with cached_network_image after i upgraded from flutter 3.10.0 (Master channel) to flutter 3.13.1. Switching to the stable channel solved the issue for me.

  1. Check wich channel you are using. Type on the terminal: flutter channel. Your current channel is mark with a star like you can see on the image enter image description here
  2. If you are not on the stable channel, then switch to it with: flutter channel stable
  3. Finish with: flutter upgrade

Upvotes: 1

Parag
Parag

Reputation: 75

enter image description hereBasically the awesome notifications is trying to access "DecoderBufferCallback" variable from the flutter library but sadly in the flutter library they changed that variable name to "DecoderCallback"...

SO you need to actually edit the variable name in the library code of AwesomeNotifications from "DecoderBufferCallback" to "DecoderCallback".. This is their job but we are doing it for them

P.S.: I know the awesoome notifications version is older in this screenshot but i just wanted to show where to do the edit... so i opened up an older project

Upvotes: 1

Related Questions