title: Override method onAttachedToEngine never gets called in FlutterPlugin
body: <p>I'm trying to implement a flutter plugin but somehow the override function <code>onAttachedToEngine</code> never gets called. According to this <a href="https://api.flutter.dev/javadoc/io/flutter/embedding/engine/plugins/FlutterPlugin.html" rel="nofollow noreferrer">doc</a></p>
  
  <blockquote>
    <p>During the call to PluginRegistry.add(FlutterPlugin), the
    FlutterEngine will invoke onAttachedToEngine(FlutterPluginBinding) on
    the given FlutterPlugin.</p>
  </blockquote>
  
  <p>but it is never invoked. One thing I have noticed though is that it actually invokes the first time you build and debug the app, and ceases after any rebuilds thereafter.
  Here is my code:</p>
  
  <pre><code>public class Plugin : FlutterPlugin, MethodCallHandler { 
  
  override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
    channel = MethodChannel(flutterPluginBinding.getFlutterEngine().getDartExecutor(), "flutter_plugin")
    channel.setMethodCallHandler(this)
    println("Engine is attached!")
  }
  
  companion object {
    @JvmStatic
    fun registerWith(registrar: Registrar) {
      val channel = MethodChannel(registrar.messenger(), "flutter_blockstack")
      channel.setMethodCallHandler(FlutterBlockstackPlugin())
      println("Registered!")
    }
  }
  
  
  override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
  if (call.method == "getPlatformVersion") {
      result.success("Android ${android.os.Build.VERSION.RELEASE}")
    } else {
      result.notImplemented()
    }
  }
  </code></pre>
  
  <p>}</p>