Xcode 8: UI 测试找不到正在测试的库
Xcode 8: UI tests can't find library being tested
当我创建 iOS 项目时,我选择不包含 UI 测试。不过现在,我尝试添加它们,但是当我尝试执行它们时出现以下错误:
dyld: Library not loaded: @rpath/FrameworkBeingTested.framework/FrameworkBeingTested
Referenced from: <redacted>/TargetApplication.app/TargetApplication
Reason: image not found
我已经确认:
- UI 测试包含在
Test
方案中,
- UI 测试目标设置为使用正确的目标应用程序 (
TargetApplication
),并且
- UI 测试文件是
FrameworkBeingTestedUITests
目标的成员。
当我将 UI 测试文件的目标成员更改为 FrameworkBeingTestedTests
而不是 FrameworkBeingTestedUITests
:
时,我找到了答案
啊哈!问题是我的 FrameworkBeingTested
将 iOS 8.0 作为其最低目标,但 Apple 的 UI 测试框架需要 iOS 9.0 或更新版本。但是编译器并没有告诉我这个,而是告诉我它无法加载经过测试的库。我会为此提交一个雷达。
希望这对某人有所帮助!
当我创建 iOS 项目时,我选择不包含 UI 测试。不过现在,我尝试添加它们,但是当我尝试执行它们时出现以下错误:
dyld: Library not loaded: @rpath/FrameworkBeingTested.framework/FrameworkBeingTested
Referenced from: <redacted>/TargetApplication.app/TargetApplication
Reason: image not found
我已经确认:
- UI 测试包含在
Test
方案中, - UI 测试目标设置为使用正确的目标应用程序 (
TargetApplication
),并且 - UI 测试文件是
FrameworkBeingTestedUITests
目标的成员。
当我将 UI 测试文件的目标成员更改为 FrameworkBeingTestedTests
而不是 FrameworkBeingTestedUITests
:
啊哈!问题是我的 FrameworkBeingTested
将 iOS 8.0 作为其最低目标,但 Apple 的 UI 测试框架需要 iOS 9.0 或更新版本。但是编译器并没有告诉我这个,而是告诉我它无法加载经过测试的库。我会为此提交一个雷达。
希望这对某人有所帮助!