3

So,this is the error,I record my UI script done,but the error occurred when I replayed the UI script.the console show :

"dyld: Library not loaded: @rpath/XCTest.framework/XCTest Referenced from: /var/containers/Bundle/Application/6D093D58-4246-40F6-A1E5-9B51018453E5/UITest7UITests-Runner.app/XCTRunner Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/6D093D58-4246-40F6-A1E5-9B51018453E5/UITest7UITests-Runner.app/Frameworks/XCTest.framework/XCTest: code signing blocked mmap() of '/private/var/containers/Bundle/Application/6D093D58-4246-40F6-A1E5-9B51018453E5/UITest7UITests-Runner.app/Frameworks/XCTest.framework/XCTest' /private/var/containers/Bundle/Application/6D093D58-4246-40F6-A1E5-9B51018453E5/UITest7UITests-Runner.app/Frameworks/XCTest.framework/XCTest: code signing blocked mmap() of '/private/var/containers/Bundle/Application/6D093D58-4246-40F6-A1E5-9B51018453E5/UITest7UITests-Runner.app/Frameworks/XCTest.framework/XCTest'"

There is a same question:Xcode 6.1 dyld: Library not loaded: @rpath/XCTest.framework/XCTest error; but my error can not be solved,and the message showed:

"ld: framework not found XCTest clang: error: linker command failed with exit code 1 (use -v to see invocation)" But in this path he tolded I really can be found the framework named XCTest.framework

enter image description here

So what can I do,thanks very much!

Community
  • 1
  • 1
PX Cheng
  • 101
  • 1
  • 6

2 Answers2

3

If you used Cocoapods, i guess you add some Unit Test framework that includes XCTest as a dependency at podfile.

But this framework can only add to TestTarget. which like this:

target 'MyProjectTargetTest' do
   pod 'Kiwi'  
end
Peter Tretyakov
  • 3,380
  • 6
  • 38
  • 54
duke.Wu
  • 31
  • 2
0

Try change Requared to Optional. Its help to me.

Bimawa
  • 3,535
  • 2
  • 25
  • 45