how to fix the below error after upgrading my flutter - flutter

/C:/Users/Funmi/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/isolate_bloc-1.0.4/lib/src/common/isolate/platform_channel/isolated_platform_channel_middleware.dart:29:25: Error: The method 'setMockMessageHandler' isn't defined for the class 'BinaryMessenger'.
'BinaryMessenger' is from 'package:flutter/src/services/binary_messenger.dart' ('/C:/Users/Funmi/flutter/packages/flutter/lib/src/services/binary_messenger.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
platformMessenger.setMockMessageHandler(channel, (message) {
^^^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\Funmi\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1052
What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
Process 'command 'C:\Users\Funmi\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 39s
Running Gradle task 'assembleRelease'... 40.2s
Gradle task assembleRelease failed with exit code 1

Finished with error: Gradle task assembleRelease failed with exit code 1
check this website and apply it by order some values end of the implementation or classpath could be old , search and change compared to depracated.

Related

Error: The method 'copyWith' isn't defined for the class 'RouteSettings'

I'm trying to run a sample of flutter , that thingsboard.io published in this starting guide.
sample code : https://github.com/thingsboard/flutter_thingsboard_app
when i run start debuging in VS Code, i get this error:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
/C:/src/flutter/.pub-cache/hosted/pub.dev/fluro-2.0.3/lib/src/fluro_router.dart:134:37: Error: The method 'copyWith' isn't defined for the class 'RouteSettings'.
- 'RouteSettings' is from 'package:flutter/src/widgets/navigator.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/navigator.dart').
Try correcting the name to the name of an existing method, or defining a method named 'copyWith'.
settingsToUse = settingsToUse.copyWith(name: path);
^^^^^^^^
Target kernel_snapshot failed: Exception
FAILURE: Build completed with 2 failures.
1: Task 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)
* 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 2m 8s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
i'm newborn in mobile application, please help me, what should i do?
i want run this sample by VS code.

Error: The getter 'SystemMouseCursors' isn't defined for the class '_LegendItemState'

I'm using Flutter to code the frontend interface of my App but I got this problem. I don't get it, can you help me understand the error ?
The error :
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_core-19.4.56/lib/src/legend/legend.dart:1329:21: Error: The getter 'SystemMouseCursors' isn't defined for the class '_LegendItemState'.
'_LegendItemState' is from 'package:syncfusion_flutter_core/src/legend/legend.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_core-19.4.56/lib/src/legend/legend.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'SystemMouseCursors'. cursor: SystemMouseCursors.click, ^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
Where: Script '/Users/macbookpro/Documents/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991
What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/macbookpro/Documents/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 20s Exception: Gradle task assembleDebug failed with exit code 1

Failed to build after upgrade to flutter 1.2

../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:28: Error: Type 'DiagnosticableMixin' not found.
class DatePickerTheme with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class DatePickerTheme with DiagnosticableMixin {
^
FAILURE: Build failed with an exception.
* Where:
Script '/home/tfradebe/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/tfradebe/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 28s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 29.1s
Exception: Gradle task assembleDebug failed with exit code 1
There is a fix in progress to solve this issue that affected many plugins. In the meantime, you can include the reference to flutter_datetime_picker like this
flutter_datetime_picker:
git:
url: https://github.com/ditheshthegreat/flutter_datetime_picker # Repo
ref: patch-1 # Branch name
This is the github related ticket

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

Finished with error: Gradle task assembleDebug failed with exit code 1 in Flutter

Compiler message:
lib/range_slider.dart:2:8: Error: Can't access platform private library.
import 'dart:_http';
^
Compiler failed on /Users/user/FlutterApp/cliniva_doctor_app/lib/main.dart
FAILURE: Build failed with an exception.
Where:
Script '/Users/user/Library/FlutterSDK/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 782
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebugArm64'.
Process 'command '/Users/user/Library/FlutterSDK/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 12s
Finished with error: Gradle task assembleDebug failed with exit code 1