setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic> - flutter

The plugin flutter_facebook_login uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib\main.dart on Pixel 6 in debug mode...
Running Gradle task 'assembleDebug'...
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
channel.setMockMessageHandler((dynamic message) async {
^^^^^^^^^^^^^^^^^^^^^
/C:/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:475:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/SDK/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
channel.setMockMessageHandler((dynamic message) async {
^^^^^^^^^^^^^^^^^^^^^
/C:/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:487:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/SDK/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
channel.setMockMessageHandler((dynamic message) async {
^^^^^^^^^^^^^^^^^^^^^
/C:/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:499:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/SDK/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
channel.setMockMessageHandler((dynamic message) async {
^^^^^^^^^^^^^^^^^^^^^
/C:/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:510:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/SDK/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
channel.setMockMessageHandler((dynamic message) async {
^^^^^^^^^^^^^^^^^^^^^
/C:/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:521:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/SDK/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
channel.setMockMessageHandler((dynamic message) async {
^^^^^^^^^^^^^^^^^^^^^
/C:/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:532:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/SDK/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
channel.setMockMessageHandler((dynamic message) async {
^^^^^^^^^^^^^^^^^^^^^
/C:/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:544:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/SDK/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
channel.setMockMessageHandler((dynamic message) async {
^^^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
Where:
Script 'C:\SDK\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\SDK\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 48s
Exception: Gradle task assembleDebug failed with exit code 1

Something is wrong with using the camera module, try to remove it.

Related

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

Flutter Compiling Debugging Error With Gradle

Recently i am want running some old app from another open source but when trying to compile with the same SDK with pubspec.yaml but having this kind problem
., [12/12/2022 11:37 PM]
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_redux-0.6.0/lib/flutter_redux.dart:77:19: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
., [12/12/2022 11:37 PM]
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
? context.inheritFromWidgetOfExactType(type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_redux-0.6.0/lib/flutter_redux.dart:79:14: Error: The method 'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.
., [12/12/2022 11:37 PM]
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
package:flutter/…/widgets/framework.dart:1
Try correcting the name to the name of an existing method, or defining a method named 'ancestorInheritedElementForWidgetOfExactType'.
.ancestorInheritedElementForWidgetOfExactType(type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_circular_chart-0.1.0/lib/src/animated_circular_chart.dart:122:10: Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
., [12/12/2022 11:38 PM]
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1
., [12/12/2022 11:38 PM]
* 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 7m 25s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I am still confuse what the solution is can you guys help? thank you for your guys help and advance God bless you all!
Your package flutter_redux-0.6.0 is three years old!
It does not work with the current Flutter version any more.
Use version 0.10.0
This is because the Flutter API changed slightly.
Now instead of using inheritFromWidgetOfExactType you have to use dependOnInheritedWidgetOfExactType
dependOnInheritedWidgetOfExactType takes Type as a generic.
From this:
final widget = context.inheritFromWidgetOfExactType(MyInheritedWidget) as MyInheritedWidget;
Migrated to:
final widget = context.dependOnInheritedWidgetOfExactType<MyInheritedWidget>();

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

I built an app in flutter but during run time i get A secondary container isnt defined for ColorScheme error

Launching lib\main.dart on SOV36 in debug mode...
lib\main.dart:1
: Error: The getter 'secondaryContainer' isn't defined for the class 'ColorScheme'.
../…/pointers/marker_pointer_renderer.dart:631
'ColorScheme' is from 'package:flutter/src/material/color_scheme.dart' ('../flutter/packages/flutter/lib/src/material/color_scheme.dart').
package:flutter/…/material/color_scheme.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'secondaryContainer'.
_themeData.colorScheme.secondaryContainer.withOpacity(0.8)
^^^^^^^^^^^^^^^^^^
: Error: The getter 'secondaryContainer' isn't defined for the class 'ColorScheme'.
../…/pointers/marker_pointer_renderer.dart:642
'ColorScheme' is from 'package:flutter/src/material/color_scheme.dart' ('../flutter/packages/flutter/lib/src/material/color_scheme.dart').
package:flutter/…/material/color_scheme.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'secondaryContainer'.
_themeData.colorScheme.secondaryContainer.withOpacity(0.12)
^^^^^^^^^^^^^^^^^^
: Error: The getter 'secondaryContainer' isn't defined for the class 'ColorScheme'.
../…/pointers/range_pointer_renderer.dart:567
'ColorScheme' is from 'package:flutter/src/material/color_scheme.dart' ('../flutter/packages/flutter/lib/src/material/color_scheme.dart').
package:flutter/…/material/color_scheme.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'secondaryContainer'.
_themeData.colorScheme.secondaryContainer.withOpacity(0.8)
^^^^^^^^^^^^^^^^^^
2
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\JONAH\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\Users\JONAH\Documents\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.
Try upgrade flutter.
flutter upgrade
flutter pub upgrade

Build failed with an exception. Flutter Framework

Launching lib\main.dart on sdk gphone x86 in debug mode...
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/delegate_widget.dart:194:18: Error: Superclass has no method named 'inheritFromElement'.
return super.inheritFromElement(ancestor, aspect: aspect);
^^^^^^^^^^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:259:19: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
? context.inheritFromWidgetOfExactType(type) as InheritedProvider<T>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:260:19: Error: The method 'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'ancestorInheritedElementForWidgetOfExactType'.
: context.ancestorInheritedElementForWidgetOfExactType(type)?.widget
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1