原生iOS集成FlutterFlutter面试

Flutter-工程通过gitsubmodule的形式集成flu

2019-03-19  本文已影响0人  念_夕

混编配置

1、Native-Flutter混编基础配置
具体配置参考如下文章
flutter-native混编
2、使用git submodule 管理flutter模块

git submodule add [git repo] [target dir] //为工程添加子模块
git submodule init
git submodule update --remote //作用类似 git fetch 

3、进入到flutter工程目录,拉取flutter远端代码,并初始化flutter工程

iOS-issues

1、iOS-flutter 混编项目,xcode运行到一半(在编译flutter模块的时候),停止xcode并重新运行,报flutter相关文件找不到

2、flutter_assets文件夹未能正确生成(iOS工程里,资源文件需要按要求配置,使用的时候才能寻址找到),这个文件夹用来存放flutter侧相关资源。

错误信息:
Failed to find assets path for "flutter_assets"
[VERBOSE-2:engine.cc(111)] Engine run configuration was invalid.
[VERBOSE-2:FlutterViewController.mm(462)] Could not launch engine with configuration.
flutter: Observatory listening on http://127.0.0.1:54632/

以下是一种解决方案,解决了我目前遇到的问题(引用到的flutter三方库并在flutter侧添加了图片资源,未能生成flutter_assets文件夹)

Android-issues

Flutter-Android趟坑笔记

上一篇 下一篇

猜你喜欢

热点阅读