CachedNetworkImage throwing error after upgrading to latest Flutter Stable version - flutter

I upgraded Flutter today to version v1.12.13 but when I run the app, I get the following error -
Compiler message:
../../../../.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'.
ImageStreamCompleter load(CachedNetworkImageProvider key) {
^
../../flutter_src/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
ImageStreamCompleter load(T key, DecoderCallback decode);
^
../../../../.pub-cache/hosted/pub.dartlang.org/multi_image_picker-4.5.9/lib/src/asset_thumb_provider.dart:31:24: Error: The method 'AssetThumbImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.
ImageStreamCompleter load(AssetThumbImageProvider key) {
^
../../flutter_src/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.
I am using the latest version of CachedNetworkImageProvider.

This currently looks like an active issue. Changing the version to 2.0.0-rc fixes the error for time being.

As mentioned in the official page
Breaking change with ImageProvider.load in Flutter 1.10
The Flutter team made a breaking change with the ImageProvider in Flutter 1.10.15 (currently Master channel only).
If you are experiencing one of the following errors upgrade to 2.0.0-rc.
switch to cached_network_image: ^2.0.0-rc
If the issue still persists then try flutter clean and run.

Related

i get this error when debug my Flutter app

Launching lib\main.dart on sdk gphone x86 in debug mode...
main.dart:1
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4919:27: Error: Expected an identifier, but got ','.
Try inserting an identifier before ','.
Widget build() => state.,build(this);
^
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4919:27: Error: Expected a class member, but got ','.
Widget build() => state.,build(this);
^
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4919:34: Error: 'this' can't be used as an identifier because it's a keyword.
Try renaming this to be an identifier that isn't a keyword.
Widget build() => state.,build(this);
^^^^
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4919:28: Error: 'build' is already declared in this scope.
Widget build() => state.,build(this);
^^^^^
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4919:10: Context: Previous declaration of 'build'.
Widget build() => state.,build(this);
^^^^^
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4888:7: Error: The non-abstract class 'StatefulElement' is missing implementations for these members:
StatefulElement.build
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 StatefulElement extends ComponentElement {
^^^^^^^^^^^^^^^
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4919:28: Context: 'StatefulElement.build' is defined here.
Widget build() => state.,build(this);
^^^^^
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4919:27: Error: Expected an identifier, but got ''.
Try inserting an identifier before ''.
Widget build() => state.,build(this);
^
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4919:26: Error: Expected ';' after this.
Widget build() => state.,build(this);
^
2
FAILURE: Build failed with an exception.
Where:
Script 'D:\program\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'D:\program\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 27s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
this error hapend when dupg my flutter app how can solve this problem
The main problem is described here:
/D:/program/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart:4919:28: Context: 'StatefulElement.build' is defined here. Widget build() => state.,build(this);
I expect you have debugged your code and maybe accidentally put the comma in the framework.dart file.
Go to this specific file, double-check and remove the comma.

Flutter run and build issue

The app was working fine but suddenlly its start showing the error when try to run or build
lib/main.dart:1
: Error: The getter 'mounted' isn't defined for the class 'BuildContext'.
../…/lib/fluttertoast.dart:154
'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../flutter/packages/flutter/lib/src/widgets/framework.dart').
package:flutter/…/widgets/framework.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'mounted'.
if (context?.mounted != true) {
^^^^^^^
2
FAILURE: Build failed with an exception.
Where:
Script '/Users/me/Documents/flutter/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/me/Documents/flutter/flutter/bin/flutter'' finished with non-zero exit value 1
I believe there may be other ways to solve it, but I solved it by updating flutter with flutter upgrade

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
Basically 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

No named parameter with the name 'findProxy'

when i run my codes it gives this error
Launching lib/main.dart on Chrome in debug mode...
lib/main.dart:1
: Error: No named parameter with the name 'findProxy'.
../…/src/http.dart:60
findProxy: findProxy,
^^^^^^^^^
: Context: Found this candidate, but the arguments don't match.
../…/html/http_request_html.dart:13
HttpRequestImpl({
^^^^^^^^^^^^^^^
Failed to compile application.
Exited (sigterm)
anyone knows what is the problem..?
thanks

I want to solve the failure of build in Flutter App

while taking build some 3rd party packages like flutter_form_builder,flutter_chips_inputalso flutter services packages throws error,that leads to build failure ,I think that is package version crash problem.... but, i can't solve this problem....
How can i solve it?
below is error code.
thank you.
ERROR CODE
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_form_builder-3.7.2/lib/src/fields/form_builder_range_slider.dart:21:9: Error: Type 'RangeSemanticFormatterCallback' not found.
final RangeSemanticFormatterCallback semanticFormatterCallback;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_chips_input-1.6.1/lib/src/chips_input.dart:62:7: Error: The non-abstract class 'ChipsInputState' is missing implementations for these members:
- TextInputClient.currentAutofillScope
- TextInputClient.currentTextEditingValue
- TextInputClient.performPrivateCommand
- TextInputClient.showAutocorrectionPromptRect
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 ChipsInputState<T> extends State<ChipsInput<T>>
^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:805:22: Context: 'TextInputClient.currentAutofillScope' is defined here.
AutofillScope? get currentAutofillScope;
^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:793:25: Context: 'TextInputClient.currentTextEditingValue' is defined here.
TextEditingValue? get currentTextEditingValue;
^^^^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:814:8: Context: 'TextInputClient.performPrivateCommand' is defined here.
void performPrivateCommand(String action, Map<String, dynamic> data);
^^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:823:8: Context: 'TextInputClient.showAutocorrectionPromptRect' is defined here.
void showAutocorrectionPromptRect(int start, int end);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:273:8: Error: The method 'FlushbarRoute.install' has more required arguments than those of overridden method 'OverlayRoute.install'.
void install(OverlayEntry insertionPoint) {
^
../flutter/packages/flutter/lib/src/widgets/routes.dart:46:8: Context: This is the overridden method ('install').
void install() {
^
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_form_builder-3.7.2/lib/src/fields/form_builder_range_slider.dart:21:9: Error: 'RangeSemanticFormatterCallback' isn't a type.
final RangeSemanticFormatterCallback semanticFormatterCallback;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:281:18: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
super.install(insertionPoint);
^
FAILURE: Build failed with an exception.
* Where:
Script '/Users/gabriel/Git/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 900
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/gabriel/Git/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 32s
############## Solution Things ###############
That situation is caused by selecting wrong package version....
so, i try to change version of "flutter_form_builder"!
and i solved this problem!
This is due to incompatibilty of flutter_form_builder with your version of flutter. As advised on the github page of flutter_form_builder, you need to choose the plugin according to your version of flutter.
From the github page:
For Flutter 1.17.x, use version 3.12.x
For Flutter 1.20.x, use version 3.13.x
For Flutter 1.22.X, use version 3.14.x
You have to type the correct version number in pubspec.yaml
Remove pubspec.lock, remove podfile.lock, and run
cd ios && pod repo update && cd .. && flutter clean && flutter pub get