Main function not running after switching to dev branch and upgrading flutter. Giving me below Errors - flutter

/C:/Intel/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.18.1/lib/src/picture_provider.dart:50:59: Error: No named parameter with the name 'nullOk'.
context != null ? Localizations.localeOf(context, nullOk: true) : null,
^^^^^^
/C:/Intel/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match.
static Locale localeOf(BuildContext context) {
^^^^^^^^
3
FAILURE: Build failed with an exception.
Where:
Script 'C:\Intel\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\Intel\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 30s
Exception: Gradle task assembleDebug failed with exit code 1

Please check what version do you have for the SVG package. In case it has a "1.3.0^" try just "1.3.0" instead. I mean version without the '^' symbol.
This worked for me!

Related

Flutter Error at runningError in new project Error: Couldn't find constructor 'StandardMessageCodec'

I had these errors didn't upgrade to the new version I even created a new project but I had the same error
^^^^^^^^^^^^^^^^^^^^
: Error: Couldn't find constructor 'StandardMessageCodec'.
../…/services/restoration.dart:326
final ByteData encoded = const StandardMessageCodec().encodeMessage(data)!;
^^^^^^^^^^^^^^^^^^^^
: Error: Couldn't find constructor 'StandardMessageCodec'.
../…/services/restoration.dart:1007
const StandardMessageCodec().encodeMessage(object);
^^^^^^^^^^^^^^^^^^^^
: Error: Couldn't find constructor 'StandardMessageCodec'.
../…/rendering/binding.dart:365
args != null ? const StandardMessageCodec().decodeMessage(args) : null,
^^^^^^^^^^^^^^^^^^^^
2
FAILURE: Build failed with an exception.
Where:
Script '/Users/abdjalildanane/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/abdjalildanane/development/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 21s
Exception: Gradle task assembleDebug failed with exit code 1

Getting error at the time of build creation with emoji_picker_flutter

i am creating build using flutter 2.10.3 and emoji_picker_flutter: 1.2.1. But it is giving this issue
/C:/Users/M.LAPTOP/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/emoji_picker_flutter-1.3.0/lib/src/emoji_picker.dart:164:44: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/Users/M.LAPTOP/fvm/versions/2.10.3/packages/flutter/lib/src/widgets/binding.dart').
Try calling using ?. instead.
(value) => WidgetsBinding.instance.addPostFrameCallback((_) {
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\M.LAPTOP\fvm\versions\2.10.3\packages\flutter_tools\gradle\flutter.gradle' line: 1102
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\Users\M.LAPTOP\fvm\versions\2.10.3\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 3m 33s
Exception: Gradle task assembleDebug failed with exit code 1
Any solutions how to solve it?
I tried updating the packages but it didn't help.

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

how to fix the below error after upgrading my 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.

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