把flutter项目在一台新电脑上跑了之后flutter run都没问题,就是一直build失败,提示:
sent 57958557 bytes received 8292 bytes 23186739.60 bytes/sec
total size is 57922417 speedup is 1.00
building file list ... done
Flutter.framework/
Flutter.framework/Flutter
Flutter.framework/Info.plist
Flutter.framework/icudtl.dat
Flutter.framework/_CodeSignature/
Flutter.framework/_CodeSignature/CodeResources
sent 100284971 bytes received 120 bytes 40114036.40 bytes/sec
total size is 100272318 speedup is 1.00
Warning: unable to build chain to self-signed root for signer "iPhone Distribution: XXX Co.,Ltd. (XXX)"
/Library/Developer/Xcode/DerivedData/Runner-cucooaalbudhwweueforwdylnldx/Build/Products/Debug-iphoneos/Runner.app/Frameworks/App.framework/App: errSecInternalComponent
Command PhaseScriptExecution failed with a nonzero exit code
每次build好久都是到最后一步失败很崩溃,困扰了好久,直到看到这个帖子: stackoverflow.com/questions/4…
尝试发现居然是证书设置的问题orz 这个方法对我来说是work的:
1- Open Keychain Access
2- Select login, and click Certificates
3- Double click Apple Worldwide Developer Relations Certificate Authority
4- Open trust section, and set to "Use System Defaults" from "Always Trust"
5- Clean build folder and run
主要是找到钥匙串下面所有的证书都检查一下,把始终信任都改成使用系统默认
重新build居然就成功了...只是每次都需要输入多次密码...但至少能打包了