The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'

Issue

After running the Flutter project, I get this error. What can I do to solve it?

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

FAILURE: Build failed with an exception.

Solution

I had the same problem after update plugin’s in AndroidStudio on Mac

flutter pub upgrade

did nothing for me, but

flutter clean
flutter pub upgrade --major-versions

has solved the problem

Answered By – Jury Dpling

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.