摘自https://juejin.im/post/5b5811...编译Flutter工程。这部分主要工作是编译Flutter的dart和资源部分,可以用AOT和Bundle命令编译。echo"Cleanoldbuild"find.-d-name"build"|xargsrm-rf./flutter/bin/fluttercleanecho"Getpackages"./flutter/bin/flutterpackagesgetecho"BuildreleaseAOT"./flutter/bin/flutterbuildaot--release--preview-dart-2--output-dir=build/flutteroutput/aotecho"BuildreleaseBundle"./flutter/bin/flutterbuildbundle--precompiled--preview-dart-2--asset-dir=build/flutteroutput/flutter_assets第一个疑问:通过flutter自己的可执行文件,执行一些暴露的function。虽然clean正常执行了,但是我看bin/flutter的内容里没有clean....不知道clean这个函数到底在哪。第二个疑问:preview-dart-2这个我也没有找到在哪...,并且aot--release,bundle--precompiled这两个命令也没百度出个所以然来。感觉好像需要装aot,bundle环境?有没有了解这一块的大佬指教一下,再说破一点。谢谢了。
2 回答
牛魔王的故事
TA贡献1830条经验 获得超3个赞
好吧,我改了flutter的sdk路径,导致path失效。纠正后,我知道了,cleanpackagesbuild都是flutter自身开放的指令。在build指令中,还有aot和bundle的指令。原来都是flutter帮我们做好了一切所需要的指令。但是我遇到了报错:Couldnotfindanoptionnamed"preview-dart-2".目前还未解决好吧。尝试了~/project/flutter/bin/flutterbuildaot--release--output-dir=build/flutteroutput/aot可以执行,猜测是不是flutter2.0优化了,不需要指定preview-dart-2了?
添加回答
举报
0/150
提交
取消