美文网首页
flutter 打包 Type mismatch: inferr

flutter 打包 Type mismatch: inferr

作者: 夜空下最亮的亮点 | 来源:发表于2020-04-13 11:54 被阅读0次

打包的时候如下错误

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)
    }
}

相关文章

网友评论

      本文标题:flutter 打包 Type mismatch: inferr

      本文链接:https://www.haomeiwen.com/subject/iilgmhtx.html