The Android section for setting up a MethodChannel or EventChannel lacks an important step: Updating the name of the Activity in the manifest.
When a new Flutter project is first created, you get an empty Activity that merely extends FlutterActivity.
This works, until you start adding native code to that Activity.
Once you modified the Activity to setup up some native code, you'll have to update the Activity name in the Manifest.xml from
This is on my backlog of things to look into. However, given my other priorities, I may not get to it for a while. If this issue needs to be completed sooner, someone else may need to take this work on.
Page URL
https://docs.flutter.dev/development/platform-integration/platform-channels?tab=type-mappings-kotlin-tab#step-3-add-an-android-platform-specific-implementation
Page source
No response
Describe the problem
The Android section for setting up a
MethodChannel
orEventChannel
lacks an important step: Updating the name of the Activity in the manifest.When a new Flutter project is first created, you get an empty Activity that merely extends
FlutterActivity
. This works, until you start adding native code to that Activity.Once you modified the Activity to setup up some native code, you'll have to update the Activity name in the Manifest.xml from
to (assuming the default name is kept)
Expected fix
Add a section that indicates that the Manifest.xml should be updated.
Additional context
Without this addition to the Manifest.xml, people will be getting
MissingPluginException
s when using the channels, despite following the tutorial.