Flutter 升級(jí)3.0后iOS運(yùn)行出現(xiàn)dyld[4083]: Library not loaded: @rpath/libswiftCore.dylib錯(cuò)誤

在Flutter開發(fā)項(xiàng)目中APP想實(shí)現(xiàn)新功能,所以需要接入新的第三方插件,但是有些第三個(gè)的Dart SDK版本要求很高矗愧,所以不得不升級(jí)Flutter SDK梯醒。于是索性把FLutter SDK升級(jí)到最新的3.X.X版本宽堆,然后遇到了iOS運(yùn)行時(shí)找不到Swift動(dòng)態(tài)庫的問題:

dyld[4083]: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: <9E270ED6-633F-3B50-95FF-9714EDA68D6B> /Users/cyclonecat/Library/Developer/CoreSimulator/Devices/638BCD07-E6BD-4978-BA3C-A4F36DD2C849/data/Containers/Bundle/Application/EF9F975D-C9E7-4E8C-BF18-2599885B7833/Runner.app/Runner
  Reason: tried: '/Users/cyclonecat/Library/Developer/Xcode/DerivedData/Runner-cthezlxggpeeajfjbmnhvhiwfscy/Build/Products/Debug-iphonesimulator/libswiftCore.dylib' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libswiftCore.dylib' (errno=2), '/Users/cyclonecat/Library/Developer/CoreSimulator/Devices/638BCD07-E6BD-4978-BA3C-A4F36DD2C849/data/Containers/Bundle/Application/EF9F975D-C9E7-4E8C-BF18-2599885B7833/Runner.app/Frameworks/libswiftCore.dylib' (errno=2), '/Users/cyclonecat/Library/Developer/CoreSimulator/Devices/638BCD07-E6BD-4978-BA3C-A4F36DD2C849/data/Containers/Bundle/Application/EF9F975D-C9E7-4E8C-BF18-2599885B7833/Runner.app/Frameworks/libswiftCore.dylib' (errno=2), '/Users/cyclonecat/Library/Developer/CoreSimulator/Devices/638BCD07-E6BD-4978-BA3C-A4F36DD2C849/data/Containers/Bundle/Application/EF9F975D-C9E7-4E8C-BF18-2599885B7833/Runner.app/Frameworks/libswiftCore.dylib' (errno=2), '/Users/cyclonecat/Library/Developer/CoreSimulator/Devices/638BCD07-E6BD-4978-BA3C-A4F36DD2C849/data/Containers/Bundle/Application/EF9F975D-C9E7-4E8C-BF18-2599885B7833/Runner.app/Frameworks/libswiftCore.dylib' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libswiftCore.dylib' (errno=2)
Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: <9E270ED6-633F-3B50-95FF-9714EDA68D6B> /Users/cyclonecat/Library/Developer/CoreSimulator/Devices/638BCD07-E6BD-4978-BA3C-A4F36DD2C849/data/Containers/Bundle/Application/EF9F975D-C9E7-4E8C-BF18-2599885B7833/Runner.app/Runner
  Reason: tried: '/Users/cyclonecat/Library/Developer/Xcode/DerivedData/Runner-cthezlxggpeeajfjbmnhvhiwfscy/Build/Products/Debug-iphonesimulator/libswiftCore.dylib' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libswiftCore.dylib' (errno=2), '/Users/cyclonecat/Library/Developer/CoreSimulator/Devices/638BCD07-E6BD-4978-BA3C-A4F36DD2C849/data/Containers/Bundle/Application/EF9F975D-C9E7-4E8C-BF18-2599885B7833/Runner.app/Frameworks/libswiftCore.dylib' (errno=2), '/Users/cyclonecat/Library/Developer/CoreSimulator/Devices/638BCD07-E6BD-4978-BA3C-A4F36DD2C849/data/Containe
dyld config: DYLD_SHARED_CACHE_DIR=/Users/cyclonecat/Library/Developer/CoreSimulator/Caches/dyld/21G115/com.apple.CoreSimulator.SimRuntime.iOS-16-0.20A360 DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/cyclonecat/Library/Developer/Xcode/DerivedData/Runner-cthezlxggpeeajfjbmnhvhiwfscy/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib DYLD_FRAMEWORK_PATH=/Users/cyclonecat/Library/Developer/Xcode/DerivedData/Runner-cthezlxggpeeajfjbmnhvhiwfscy/Build/Products/Debug-iphonesimulator DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
(lldb) 

通過百度找到了這遍dyld:Library not loaded: @rpath/libswiftCore.dylib文章,但不能解決冤馏。
后面又找到了下面的方法日麸,成功解決這個(gè)問題。
在項(xiàng)目的TARGETS下Runner的Build Settings->Linking->Runpath Search Paths配置添加/usr/bin/swift/usr/lib/swift逮光,如下圖:

然后成功運(yùn)行代箭。

參考文章:
dyld:Library not loaded: @rpath/libswiftCore.dylib(這個(gè)不適用Flutter)
Flutter ‘/usr/lib/libswiftCore.dylib‘ (no such file)
flutter各種問題

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市涕刚,隨后出現(xiàn)的幾起案子嗡综,更是在濱河造成了極大的恐慌,老刑警劉巖杜漠,帶你破解...
    沈念sama閱讀 206,311評(píng)論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件极景,死亡現(xiàn)場(chǎng)離奇詭異察净,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)盼樟,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,339評(píng)論 2 382
  • 文/潘曉璐 我一進(jìn)店門氢卡,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人晨缴,你說我怎么就攤上這事译秦。” “怎么了击碗?”我有些...
    開封第一講書人閱讀 152,671評(píng)論 0 342
  • 文/不壞的土叔 我叫張陵筑悴,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我稍途,道長(zhǎng)阁吝,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,252評(píng)論 1 279
  • 正文 為了忘掉前任械拍,我火速辦了婚禮突勇,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘坷虑。我一直安慰自己与境,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,253評(píng)論 5 371
  • 文/花漫 我一把揭開白布猖吴。 她就那樣靜靜地躺著摔刁,像睡著了一般。 火紅的嫁衣襯著肌膚如雪海蔽。 梳的紋絲不亂的頭發(fā)上共屈,一...
    開封第一講書人閱讀 49,031評(píng)論 1 285
  • 那天,我揣著相機(jī)與錄音党窜,去河邊找鬼拗引。 笑死,一個(gè)胖子當(dāng)著我的面吹牛幌衣,可吹牛的內(nèi)容都是我干的矾削。 我是一名探鬼主播,決...
    沈念sama閱讀 38,340評(píng)論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼豁护,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼哼凯!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起楚里,我...
    開封第一講書人閱讀 36,973評(píng)論 0 259
  • 序言:老撾萬榮一對(duì)情侶失蹤断部,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后班缎,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體蝴光,經(jīng)...
    沈念sama閱讀 43,466評(píng)論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡她渴,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 35,937評(píng)論 2 323
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了蔑祟。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片趁耗。...
    茶點(diǎn)故事閱讀 38,039評(píng)論 1 333
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖疆虚,靈堂內(nèi)的尸體忽然破棺而出对粪,到底是詐尸還是另有隱情,我是刑警寧澤装蓬,帶...
    沈念sama閱讀 33,701評(píng)論 4 323
  • 正文 年R本政府宣布,位于F島的核電站纱扭,受9級(jí)特大地震影響牍帚,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜乳蛾,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,254評(píng)論 3 307
  • 文/蒙蒙 一暗赶、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧肃叶,春花似錦蹂随、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,259評(píng)論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至蹦魔,卻和暖如春激率,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背勿决。 一陣腳步聲響...
    開封第一講書人閱讀 31,485評(píng)論 1 262
  • 我被黑心中介騙來泰國(guó)打工乒躺, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人低缩。 一個(gè)月前我還...
    沈念sama閱讀 45,497評(píng)論 2 354
  • 正文 我出身青樓嘉冒,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親咆繁。 傳聞我的和親對(duì)象是個(gè)殘疾皇子讳推,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,786評(píng)論 2 345

推薦閱讀更多精彩內(nèi)容