【注意】Flutter 1.24 FlutterMain被废弃了的替代方案|flutterAssetsDir on a null
Flutter 1.24 FlutterMain被废弃了,用FlutterMain.findAppBundlePath()换成HiFlutterLoader.get(),同时也能fix:
java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.embedding.engine.loader.FlutterApplicationInfo.flutterAssetsDir' on a null object reference
41
收起
正在回答 回答被采纳积分+1
1回答
CrazyCodeBoy
2020-11-18 22:59:49
将:
flutterEngine.dartExecutor.executeDartEntrypoint(
DartEntrypoint(
FlutterMain.findAppBundlePath(),
moduleName
)
)
修改为:
flutterEngine.dartExecutor.executeDartEntrypoint(
// Flutter 1.24 FlutterMain被废弃了,用FlutterMain.findAppBundlePath()换成HiFlutterLoader.get()
// ,以fix java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.embedding.engine.loader.FlutterApplicationInfo.flutterAssetsDir' on a null object reference
DartEntrypoint(
HiFlutterLoader.get().findAppBundlePath(),
moduleName
)
)
相似问题
登录后可查看更多问答,登录/注册
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星