Error: Couldn't find constructor 'network_image.NetworkImage'. const factory NetworkImage

330 views
Skip to first unread message

Raman Plaha

unread,
Feb 18, 2021, 3:36:09 AM2/18/21
to Flutter Development (flutter-dev)
hello there!
I have not changed any inbuild dart file but still getting this error 
my Logcat-

Launching lib\main.dart on AOSP on IA Emulator in debug mode...
Running Gradle task 'assembleDebug'...
/F:/flutter/packages/flutter/lib/src/painting/_network_image_io.dart:1:1: Error: Expected a declaration, but got '{'.
{
^
/F:/flutter/packages/flutter/lib/src/painting/image_provider.dart:822:92: Error: Couldn't find constructor 'network_image.NetworkImage'.
  const factory NetworkImage(String url, { double scale, Map<String, String>? headers }) = network_image.NetworkImage;
                                                                                           ^
/F:/flutter/packages/flutter/lib/src/painting/image_provider.dart:822:92: Error: Redirection constructor target not found: 'network_image.NetworkImage'
  const factory NetworkImage(String url, { double scale, Map<String, String>? headers }) = network_image.NetworkImage;
                                                                                           ^


FAILURE: Build failed with an exception.

* Where:
Script 'F:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904

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

help please!
Reply all
Reply to author
Forward
0 new messages