title: Flutter: Unhandled Exception: MissingPluginException(No implementation found for method on channel)
body: <p>I would like to call a kotlin function inside my flutter code (just to set parameters using the consent sdk), however, every time I try to call the function (currently just test code) I get the error:
  <code>Unhandled Exception: MissingPluginException(No implementation found for method getConsent on channel consent.sdk/consent)</code></p>
  
  <p>This is how my <code>MainActivity.kt</code> looks like:</p>
  
  <pre><code>import io.flutter.app.FlutterActivity
  import io.flutter.plugins.GeneratedPluginRegistrant
  import android.os.Bundle
  import io.flutter.plugin.common.MethodChannel
  
  class MainActivity: FlutterActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      GeneratedPluginRegistrant.registerWith(this)
      MethodChannel(flutterView, "consent.sdk/consent").setMethodCallHandler {
        // Note: this method is invoked on the main thread.
        call, result -&gt;
        if (call.method == "getConsent") {
          result.success("Yay")
        } else {
          result.success("Yey")
          //result.notImplemented() Commented out to see if this caused the error, but it didn't
        }
      }
    }
  }
  </code></pre>
  
  <p>And this is how I try to "run" this code in flutter:</p>
  
  <pre><code>const platform = const MethodChannel('consent.sdk/consent');
  Future&lt;String&gt; _getConsent() async {
    String result;
    try {
      result = await platform.invokeMethod('getConsent');
    } on PlatformException catch (e) {
      result = "Failed: '${e.message}'.";
    }
    return result;
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>