最近接手了个老项目,真机运行时总报下面的错误:
dyld: Library not loaded: @rpath/libswiftCore.dylib
,被折磨了两天,网上所有的方法基本上都试了,不见效果。
最后无意间看到下面的解决方案,试了下,it works for me ! so happy...
I was having this issue with running my Swift tests (but not my app). It
turns out that the test needed to have more than
@executable_path/Frameworks in it's Runpath Search Paths build
setting for the test target. Setting the Runpath Search Paths to the
following worked a charm for me:
$(inherited)
@executable_path/Frameworks
@loader_path/Frameworks
我的工程里面少加了@loader_path/Frameworks
,加上后,奇迹发生了,真机跑起来了。。。
最后附上解决办法原文,30种解决方案,总有一款适合你。😄😄