flutter 打包 Type mismatch: inferred type is FlutterEngine but PluginRegistry! was expected

打包的时候如下错误

Type mismatch: inferred type is FlutterEngine but PluginRegistry! was expected

按照一下错误路径替换如下代码
/Users/..../Desktop/flutter_money/android/app/src/main/kotlin/com/fluttermoney/www/MainActivity.kt: (10, 48):

//package com.fluttermoney.www
//
//import androidx.annotation.NonNull;
//import io.flutter.embedding.android.FlutterActivity
//import io.flutter.embedding.engine.FlutterEngine
//import io.flutter.plugins.GeneratedPluginRegistrant
//
//class MainActivity: FlutterActivity() {
//    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
//        GeneratedPluginRegistrant.registerWith(flutterEngine);
//    }
//}
package com.fluttermoney.www

import android.os.Bundle

import io.flutter.app.FlutterActivity
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        GeneratedPluginRegistrant.registerWith(this)
    }
}

推荐阅读更多精彩内容