快速框架崩溃XCTest库未加载arch x86_64



你做了什么?

安装快速框架使用pod

pod 'Quick'

你以为会发生什么?

运行演示应用程序而不崩溃

实际上发生了什么?

应用程序启动时崩溃:dyld[11272]:库未加载:@rpath/XCTest.framework/XCTest . exe参考来源:/Users/aimoresc/Library/Developer/CoreSimulator/Devices/8930165E-1256-413E-AE71-B81B78C23799/data/Containers/Bundle/Application/2D3BCC75-C97C-4F02-96C2-426D3E894DD6/QuickDemo.app/QuickDemo原因:尝试:'/Users/aimoresc/Library/Developer/Xcode/DerivedData/QuickDemo-hjyhkpgeditvlnbkokgocjlflslb/Build/Products/debug -iphone模拟器/XCTest.framework/XCTest'(没有这样的文件),'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/ios . simmruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/XCTest.framework/XCTest' (fat文件,但缺少兼容的架构(有'armv7,armv7s,arm64,arm64e',需要'x86_64'),'/usr/lib/swift/XCTest.framework/XCTest'(没有这样的文件),'/Users/aimoresc/Library/Developer/CoreSimulator/Devices/8930165E-1256-413E-AE71-B81B78C23799/data/Containers/Bundle/Application/2D3BCC75-C97C-4F02-96C2-426D3E894DD6/QuickDemo.app/Frameworks/XCTest.framework/XCTest'(没有这样的文件),'/Users/aimoresc/Library/Developer/CoreSimulator/Devices/8930165E-1256-413E-AE71-B81B78C23799/data/Containers/Bundle/Application/2D3BCC75-C97C-4F02-96C2-426D3E894DD6/QuickDemo.app/Devices/8930165E-1256-413E-AE71-B81B78C23799/data/Containers/Bundle/Application/2D3BCC75-C97C-4F02-96C2-426D3E894DD6/QuickDemo.app/Frameworks/XCTest.framework/XCTest'(没有这样的文件),'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/ios . simmruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/XCTest.framework/XCTest' (fat文件,但缺少兼容的架构(有'armv7,armv7s,arm64,arm64e',需要'x86_64')), '/usr/lib/swift/XCTest.framework/XCTest'(没有这样的文件),'/Users/aimoresc/Library/Developer/CoreSimulator/Devices/8930165E-1256-413E-AE71-B81B78C23799/data/Containers/Bundle/Application/2D3BCC75-C97C-4F02-96C2-426D3E894DD6/QuickDemo.app/Devices/8930165E-1256-413E-AE71-B81B78C23799/data/Containers/Bundle/Application/2D3BCC75-C97C-4F02-96C2-426D3E894DD6/QuickDemo.app/Frameworks/XCTest.framework/XCTest'(没有这样的文件),'/Users/aimoresc/Library/Developer/CoreSimulator/Devices/8930165E-1256-413E-AE71-B81B78C23799/data/Containers/Bundle/Application/2D3BCC75-C97C-4F02-96C2-426D3E894DD6/QuickDemo.app/Frameworks/XCTest.framework/XCTest'(没有这样的文件),'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/ios . simmruntime/Contents/runtime/System/Library/Frameworks/XCTest.framework/XCTest'(没有这样的文件)库未加载:@rpath/XCTest.framework/XCTest参考来源:/Users/aimoresc/Library/Developer/CoreSimulator/Devices/8930165E-1256-413E-AE71-B81B78C23799/data/Containers/Bundle/Application/2D3BCC75-C97C-4F02-96C2-426D3E894DD6/QuickDemo.app/QuickDemo原因:尝试:'/Users/aimoresc/Library/Developer/Xcode/DerivedData/QuickDemo-hjyhkpgeditvlnbkokgocjlflslb/Build/Products/debug -iphone模拟器/XCTest.framework/XCTest'(没有这样的文件),'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/ios . simmruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/XCTest.framework/XCTest' (fat文件,但缺少兼容的架构(有'armv7,armv7s,arm64,arm64e',需要'x86_64'),'/usr/lib/swift/XCTest.framework/XCTest'(没有这样的文件),'/Users/aimoresc/Library/Developer/CoreSimulator/Devices/8930165E-1256-413E-AE71-B81B78C23799/data/Containers/Bundle/Application/2D3BCC75-C97C-4F02-96C2-426D3E894DD6/QuickDemo.app/Frameworks/XCTest.framework/XCTest

环境

列出你正在使用的软件版本:

  • 快速:5.0

  • Xcode版本:Version 13.2.1 (13C100)

  • Swift Version: 5

  • CocoaPods: 1.11.2

XCTest框架只从测试包中可用/可加载,看起来我试图从你的应用程序目标链接/使用快速?更改.podfile,以便您只链接Quick与您的测试目标。

例如:


target 'QuickDemo' do
# List of pods for the app target
end
target 'QuickDemoTests' do
pod 'Quick'
end 

最新更新