1 运行Flutter项目报错如下
Launching lib/main.dart on iPhone (3) in debug mode…
Automatically signing iOS for device deployment using specified development team in Xcode project: xxxx
Running pod install…
Running Xcode build…
Xcode build done. 53.0s
Installing and launching…
(lldb) dyld[17086]: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /private/var/containers/Bundle/Application/CB7B3119-83E0-4959-ADD8-8253556410E5/Runner.app/Runner
Reason: tried: ‘/private/var/containers/Bundle/Application/CB7B3119-83E0-4959-ADD8-8253556410E5/Runner.app/Frameworks/libswiftCore.dylib’ (no such file), ‘/private/var/containers/Bundle/Application/CB7B3119-83E0-4959-ADD8-8253556410E5/Runner.app/Frameworks/libswiftCore.dylib’ (no such file), ‘/usr/local/lib/libswiftCore.dylib’ (no such file), ‘/usr/lib/libswiftCore.dylib’ (no such file)
thread #1, stop reason = signal SIGABRT
frame #0: 0x00000001047087a0 dyld__abort_with_payload + 8 dyld
__abort_with_payload:
-> 0x1047087a0 <+8>: b.lo 0x1047087c0 ; <+40>
0x1047087a4 <+12>: pacibsp
0x1047087a8 <+16>: stp x29, x30, [sp, #-0x10]!
0x1047087ac <+20>: mov x29, sp
Target 0: (Runner) stopped.
Error launching application on iPhone (3).
2 解决方法: 添加两个路径
/usr/bin/swift
/usr/lib/swift