混编配置能够参考这篇文章 www.jianshu.com/p/eee692736…xcode
最近开始在项目的边缘模块中尝试使用Flutter开发,对混编过程当中遇到的问题作了一些记录。bash
在Debug.xcconfig和Release.xcconfig里面添加 注意FlutterMixed 是本身iOS项目的名称
app
#include "Pods/Target Support Files/Pods-FlutterMixed/Pods-FlutterMixed.debug.xcconfig"
#include "Pods/Target Support Files/Pods-FlutterMixed/Pods-FlutterMixed.release.xcconfig"
复制代码
在项目中手动添加文件目录ui
open Project Target and add User-Defined Setting with key name FLUTTER_ROOTwith the value of your flutter SDK location.spa
三、The path lib/main.dart does not existdebug
config文件的../../路径问题code
四、dyld: Library not loaded: @rpath/Flutter.framework/Fluttercdn
五、debug环境 跳转黑屏blog
移除App.framework图片
六、Flutter doctor ,Flutter upgrade 等卡住
挂终端ss
export http_proxy=http://127.0.0.1:1087;export https_proxy=http://127.0.0.1:1087;
复制代码
端口不必定相同,根据本身的ss配置修改
七、xcode运行脚本卡住
用Android studio 运行一次flutter应用
八、iOS风格的AppBar
return new Scaffold(
appBar: new CupertinoNavigationBar(
middle: new Text('test'),
trailing: Material(child: IconButton(icon: Icon(Icons.settings))),
),
body: Text('test'),
);
复制代码
九、release包 不加载图片资源
1.更新flutter 版本
flutter upgrade
复制代码
2.删除原生项目中的App.framework及Flutter.framework文件从新添加
注:Flutter在1.2版本中将flutter_assets 文件夹的内容移到了App.framework中,不须要再将flutter_assets文件添加至原生工程中
十、上传App Store 包含[x86_64]报错
App Store Connect Operation Error
ERROR ITMS-90087: "Unsupported Architectures. The executable for LoanCalculator.app/Frameworks/Flutter.framework contains unsupported architectures '[x86_64]'."
App Store Connect Operation Error
ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'LoanCalculator.app/Frameworks/Flutter.framework/Flutter' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
App Store Connect Operation Error
ERROR ITMS-90125: "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker."
复制代码
解决方法
1.打开终端
2.cd到Flutter.framework文件夹
example : cd /Users/MAC/Desktop/Flutter/Flutter.framework
复制代码
3.执行下面代码
lipo -remove x86_64 Flutter -o Flutter
复制代码
4.从新打开项目 Clean, Build & Run and Create Archive
目前项目只是不多的一部分尝试用Flutter来写,遇到的问题就上面这些,后面踩到坑会陆续添加进来。我的对Flutter技术十分看好,可是目前就使用体验来说,我以为距离iOS原生还有不小的差距,让iOS有了安卓味,这可不太好,但愿后面会更完善吧。