Getting error at the time of build creation with emoji_picker_flutter - 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.

Related

I am seeing this error "Execution failed for task ':app:compileFlutterBuildDebug'."

I have run flutter upgrade after that it told me to Flutter App Migration from Previous Version (Android Embedding V2), and after doing it, I am seeing this error.
Error image
error message
[FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
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 32s
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.

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

/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!

Could not run Flutter app after a long time

i have developed an application before two months, i need to add a new feature today so i opened the project to day. but i cannot compile the project , it throws errors only and i don't understand how to resolve it. i have cached_network_image , youtube_player_flutter packages.
i have pasted my error log below
Compiler message:
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/youtube_player_flutter-
5.2.0/lib/src/player/raw_youtube_player.dart:55:30: Error: Getter not found: 'suspending'.
case AppLifecycleState.suspending:
^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.
FAILURE: Build failed with an exception.
* Where:
Script '/Users/flutter/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line:
780
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/flutter/Developer/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 23s
FAILURE: Build failed with an exception.
* What went wrong:
Could not get unknown property 'ANDROIDX_WARNING' for project ':youtube_player' of type
org.gradle.api.Project.
* 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 23s
Finished with error: Gradle task assembleDebug failed with exit code 1

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