运行Swift/Obj-c项目的XCTest时出错(错误83)

8e2ybdfx  于 11个月前  发布在  Swift
关注(0)|答案(4)|浏览(114)

我在尝试运行Swift/Obj-c应用的测试时遇到以下错误:

2016-02-07 00:02:26.752 xctest[3275:115122] The bundle “MyAppTests” couldn’t be loaded. Try reinstalling the bundle.
2016-02-07 00:02:26.752 xctest[3275:115122] (dlopen(/Users/raphaelcruzeiro/Library/Developer/Xcode/DerivedData/MyApp-bjdolynlskqvavgryvznzbluqele/Build/Products/Debug-iphonesimulator/MyAppTests.xctest/MyAppTests, 265): Symbol not found: _CLSDevelopmentPlatformNameKey
  Referenced from: /Users/raphaelcruzeiro/Library/Developer/Xcode/DerivedData/MyApp-bjdolynlskqvavgryvznzbluqele/Build/Products/Debug-iphonesimulator/MyAppTests.xctest/MyAppTests
  Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/xctest
 in /Users/raphaelcruzeiro/Library/Developer/Xcode/DerivedData/MyApp-bjdolynlskqvavgryvznzbluqele/Build/Products/Debug-iphonesimulator/MyAppTests.xctest/MyAppTests)
Program ended with exit code: 83

字符串
这是一个相当大的应用程序,它不使用框架,因为我需要支持iOS 7,如果这有任何区别。应用程序没有测试。我刚刚创建了第一个测试套件。

olmpazwi

olmpazwi1#

我遇到了同样的问题,这是因为主机应用程序没有设置。我不知道为什么它被重置了,但这是有道理的,因为swift文件不在测试目标中。

zynd9foi

zynd9foi2#

在这个问题上撞了我的头几次之后,我决定删除测试目标并从头开始重新创建它。这解决了我的问题。

b1zrtrql

b1zrtrql3#

我通过添加丢失的Info.plist文件解决了它。

drkbr07n

drkbr07n4#

当我的macOS单元测试目标针对比我的机器当前运行的更新的macOS最低支持版本构建时,我遇到了这个错误。

相关问题