0

I have a flutter application build +1 year ago, I updated its flutter sdk, dart and most of the packages. I followed all the steps on this answer: How do I upgrade an existing Flutter app?.

Now, after going through all the steps, I'm trying to build it and on android platform it's showing me this error .

Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
messages.dart:111
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('../../Documents/flutter/packages/flutter/lib/src/services/platform_channel.dart').
platform_channel.dart:1
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.

        channel.setMockMessageHandler(null);
                ^^^^^^^^^^^^^^^^^^^^^

While on iOS it's showing me this error:

Error (Xcode): ../../.pub-cache/hosted/pub.dev/video_player_platform_interface-2.2.0/lib/messages.dart:432:15: Error: The method 'setMockMessageHandler' isn't
defined for the class 'BasicMessageChannel<dynamic>'.

Flutter doctor:

[✓] Flutter (Channel stable, 3.7.10, on macOS 12.6.3 21G419 darwin-x64, locale en-XK)
    • Flutter version 3.7.10 on channel stable at /Users/drenicespahija/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4b12645012 (5 days ago), 2023-04-03 17:46:48 -0700
    • Engine revision ec975089ac
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/drenicespahija/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.76.2)
    • VS Code at /Users/drenicespahija/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.62.0

[✓] Connected device (4 available)
    • M2101K7BNY (mobile) • GAQSDEEI8TJVPNMN                     • android-arm64  • Android 12 (API 31)
    • iPhone 14 (mobile)  • 6A80DDC0-C120-43BC-BE8A-040FAED760DB • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)     • macos                                • darwin-x64     • macOS 12.6.3 21G419 darwin-x64
    • Chrome (web)        • chrome                               • web-javascript • Google Chrome 112.0.5615.49

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

I tried many options that internet told but none of them helped solving it.

DSpahija
  • 13
  • 3
  • The video player version you are using is too old for the current version of flutter. Check this out, you are using the version 2.2.0 of this package: https://pub.dev/packages/video_player_platform_interface/versions – Gabriel Gava Apr 08 '23 at 22:04

0 Answers0