Awesome notification V0.7.1 fails to build - flutter

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

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 - Error Compiling project without changes

I am facing an issue in flutter for a couple of days
before I close Android Studio everything was working fine with no errors so far, next day I started it with no changes, and it shows me an error message and cannot compile while there is no errors in my code or in anything
../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_dialog_action.dart:171:14:
Error: The method 'FlatButton' isn't defined for the class
'PlatformDialogAction'.
'PlatformDialogAction' is from 'package:flutter_platform_widgets/src/platform_dialog_action.dart'
('../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_dialog_action.dart').
Try correcting the name to the name of an existing method, or defining
a method named 'FlatButton'.
return FlatButton(
^^^^^^^^^^ ../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart:269:14:
Error: The method 'FlatButton' isn't defined for the class
'PlatformButton'.
'PlatformButton' is from 'package:flutter_platform_widgets/src/platform_button.dart'
('../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart').
Try correcting the name to the name of an existing method, or defining
a method named 'FlatButton'.
return FlatButton(
^^^^^^^^^^ ../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart:302:12:
Error: The method 'RaisedButton' isn't defined for the class
'PlatformButton'.
'PlatformButton' is from 'package:flutter_platform_widgets/src/platform_button.dart'
('../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart').
Try correcting the name to the name of an existing method, or defining
a method named 'RaisedButton'.
return RaisedButton(
^^^^^^^^^^^^ Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
Where: Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line:
1151
What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\src\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 10s Exception: Gradle task assembleDebug failed with
exit code 1
I tried to restart, search, and made everything but then nothing worked for me
Does anybody have an idea why is that happening?
thanks in advance

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

i update my flutter version Error in ruining flutter app

i update my flutter version to last update and i have error when in running my app
error:
Launching lib\main.dart on sdk gphone x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.
class PictureStream with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found.
abstract class PictureStreamCompleter with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class PictureStream with DiagnosticableMixin {
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in.
abstract class PictureStreamCompleter with DiagnosticableMixin {
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'.
super.debugFillProperties(properties);
^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.
'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'.
ifPresent: _completer?.toStringShort(),
^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'.
super.debugFillProperties(description);
^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\lenovo\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\Users\lenovo\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 52s
Exception: Gradle task assembleDebug failed with exit code 1
-- Run pub upgrade in the pubspec.yaml
-- Run pub get in the pubspec.yaml
-- Then run Flutter Clean
-- Restart your IDE
I faced similar error and that worked for me

Finished with error: Gradle task assembleDebug failed with exit code 1, When I updated Flutter SDK to v1.12.13+hotfix.5

Compiler message:
../../../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'.
ImageStreamCompleter load(CachedNetworkImageProvider key) {
^
../../../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 '/Users/shutter/Desktop/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 780
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/shutter/Desktop/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 1s
Finished with error: Gradle task assembleDebug failed with exit code 1
Just replace cached_network_image:1.1.3 with cached_network_image: ^2.0.0-rc in your pubspec.yaml file, refer this for more.
Flutter v1.12.13 is having issues
I have resolved this issue by doing following changes
Switch to master channel of flutter
Update flutter to 1.13.5
created new project
copy paste old files into new project
Voila it's worked