Michael Wagih
Michael Wagih

Reputation: 31

When I run Flutter project I got this error my Ubuntu system

Compiler message

../../../../Android/flutter_linux_v1.12.13+hotfix.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/cached_network_image-1.1.3/lib/src/cached_network_image_provider.dart:42:24: 

Error: The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.

Method

ImageStreamCompleter load(CachedNetworkImageProvider key) {
                       ^
../../../../Android/flutter_linux_v1.12.13+hotfix.5-stable/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: 

Context: This is the overridden method ('load').
  ImageStreamCompleter load(T key, DecoderCallback decode);
                   ^


Target kernel_snapshot failed: Exception: Errors during snapshot creation: null

build failed.

FAILURE:

Build failed with an exception.

* Where:
Script '/home/omelnour/Android/flutter_linux_v1.12.13+hotfix.5-stable/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 780

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/omelnour/Android/flutter_linux_v1.12.13+hotfix.5-stable/flutter/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 1m 7s
Finished with error: Gradle task assembleDebug failed with exit code 1

Upvotes: 0

Views: 166

Answers (1)

dlohani
dlohani

Reputation: 2591

This is the problem with older version of cached_network_image Just update to the latest version of cached_network_image which is 2.0.0, so in your pubspec.yaml file where you have

cached_network_image: ^1.1.3 change 1.1.3 with 2.0.0.

Upvotes: 1

Related Questions