Can't build flutter project when opening it after a long time

Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.

FAILURE: Build failed with an exception.

Any help would be appreciated

This didn't fixed it : flutter pub upgrade

Note : I don't want to do this (flutter pub upgrade --major-versions) as doing this breaks the entire project and introduces dozens of more errors and bug

Below is the complete error message:

* Running Gradle task 'assembleRelease'...
/E:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:432:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.

  • 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:440:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
  • 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:451:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
  • 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:463:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
  • 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/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' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/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' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/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' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/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' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/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' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/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' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/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' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0+1/lib/messages.dart:96:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
  • 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/E:/src/flutter/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(null); ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0+1/lib/messages.dart:98:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
  • 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/E:/src/flutter/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 { ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0+1/lib/messages.dart:111:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
  • 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/E:/src/flutter/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(null); ^^^^^^^^^^^^^^^^^^^^^ /E:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0+1/lib/messages.dart:113:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel'.
  • 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/E:/src/flutter/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 'E:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005

  • What went wrong: Execution failed for task ':app:compileFlutterBuildRelease'.

Process 'command 'E:\src\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 1m 2s Running Gradle task 'assembleRelease'... 63.1s Gradle task assembleRelease failed with exit code 1 Process finished with exit code 1 *



from Recent Questions - Stack Overflow https://ift.tt/39Lzrsx
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation