dyld错误:启动iOS应用时未加载库:@rpath/libswiftCore.dylib
大家好!我是Swift和Xcode的新手,遇到了一个奇怪的错误。我创建了一个简单的iOS项目(Single View App),使用Swift,添加了几个UI元素(UILabel, UIButton),并编写了简单的按钮点击处理代码。一切编译无误,但当我尝试在iPhone 14 Pro模拟器(iOS 16.4)上运行应用时,它启动后立即崩溃,控制台显示:
```
dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /Users/username/Library/Developer/CoreSimulator/Devices/.../App.app/App
Reason: no suitable image found. Did find:
/Users/username/Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphonesimulator/libswiftCore.dylib: mach-o, but wrong architecture
```
我已经尝试过:
1. 清理DerivedData(Product → Clean Build Folder)
2. 重启Xcode和模拟器
3. 检查目标平台是否正确选择(iOS 16.4)
4. 确保在Build Settings中启用了Swift(Always Embed Swift Sta