I faced this issue while implementing platform specific code. I want to share my experience in this case.
First clean the project using
flutter clean
Then upgrade the plugins using
flutter pub get
Then run project(Not hot reload. Plugins will inject codes)
flutter run
If the problem persist again, you may be missing
GeneratedPluginRegistrant.registerWith(flutterEngine)
which you have to place here
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
//***HERE***
GeneratedPluginRegistrant.registerWith(flutterEngine)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, BEACON_ACTIVATE_CHANNEL).setMethodCallHandler{
call, result ->
when {
call.method.equals("yourMethodName") -> {
yourNativeFunction(call, result)
}
}
}
}