dyld错误:启动iOS应用时未加载库:@rpath/libswiftCore.dylib
大家好!我是一名iOS开发新手,正在用Swift编写我的第一个应用。我使用的是Xcode 14,项目是从零开始创建的,采用了标准的Single View App模板。之前一切都能正常构建和运行,但在我通过CocoaPods添加了几个第三方库(Alamofire和SwiftyJSON)后,在iPhone 14 Pro模拟器(iOS 16.2)上启动时出现了错误:
dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /Users/username/Library/Developer/CoreSimulator/Devices/.../.../MyApp.app/Frameworks/libswiftCore.dylib
Reason: no suitable image found. Did find:
/Users/username/Library/Developer/CoreSimulator/Devices/.../.../MyApp.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x..., size=0x... segment=__TEXT with unix errno=1 (Unknown error: 0)
应用会打开,显示白屏一秒钟然后崩溃。这是我的Podfile:
platform :ios, '15.0'
target 'MyApp' do
use_frameworks!
pod 'Alamofire', '~> 5.6'
pod 'SwiftyJSON', '~>