1.在原生的iOS工程里面更米,嵌套了flutter模塊,進(jìn)行打包時(shí)镶蹋,報(bào)以下錯(cuò)誤:
ld: bitcode bundle could not be generated because ‘/Users/—/ios/Flutter/Flutter.framework/Flutter’ was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file ‘/Users/—r/ios/Flutter/Flutter.framework/Flutter’ for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) Search for Enable Bitcode setting and set it to YES for Debug and Release modes.
從報(bào)錯(cuò)信息來看邦邦,該報(bào)錯(cuò)信息是因?yàn)閒lutter模塊里面的內(nèi)容不是全部支持bitcode導(dǎo)致的及舍,但我將項(xiàng)目里面的Enable Bitcode設(shè)置為NO時(shí)贤徒,并沒有解決問題:
最后在Stack Overflow上面找到了答案芹壕,正確操作是:不需要將Enable Bitcode設(shè)置為NO汇四,在flutter項(xiàng)目里面,依次執(zhí)行以下命令:
flutter clean
flutter build ios
然后再在原生工程里面做正常的打包操作踢涌,成功M酢!
————————————————
2.flutter打包出現(xiàn)支持架構(gòu)報(bào)錯(cuò)
報(bào)錯(cuò)原因:打包時(shí)應(yīng)該是在真機(jī)設(shè)備上的支持架構(gòu)睁壁,但是flutter.framework所支持的架構(gòu)包含了模擬器的架構(gòu)背苦,所以報(bào)錯(cuò)。故將虛擬機(jī)架構(gòu)從所支持的架構(gòu)中移除就好了潘明。
一行剂、iOS設(shè)備支持的指令集
armv6:
iPhone, iPhone 3G, iPod 1G/2G
armv7:
iPhone 3GS, iPhone 4, iPhone 4S, iPod 3G/4G/5G, iPad, iPad 2, iPad 3, iPad Mini
armv7s:
iPhone 5, iPhone 5c, iPad 4
arm64:
iPhone X,iPhone 8(Plus)钉疫,iPhone 7(Plus),iPhone 6(Plus)巢价,iPhone 6s(Plus), iPhone 5s, iPad Air(2), Retina iPad Mini(2,3)
arm64e:
iPhone XS\XR\XS Max
二牲阁、編譯出現(xiàn)報(bào)錯(cuò)
打包時(shí)Xcode報(bào)錯(cuò)
flutter.framework支持架構(gòu)過多
三、解決辦法
在2019年8月份之前的flutter moudel的集成方式可按照以下方式去集成
方法1.刪除對應(yīng)Flutter.framework的x86_64架構(gòu)
cd 到/path/xxx.framework位置
lipo -info /path/xxx.framework/xxx 查看框架支持的架構(gòu)
如:lipo -info Users/pppppp/oooooo/path/xxx.framework/xxx
刪除Flutter模塊x86_64:lipo -remove x86_64 xxx -o xxx
如:lipo -remove x86_64 Flutter -o Flutter
方法2.在最后run script中壤躲,添加"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin