Xcode 5.0.2 dyld: Library not loaded: @rpath/XCTest.framework/Versions/A/XCTest

后端 未结 15 760
再見小時候
再見小時候 2020-12-08 19:54

I have problems running a project in Xcode 5.0.2

I get the following error:

dyld: Library not loaded: @rpath/XCTest.framework/Versions/A/XCTest
  Ref         


        
相关标签:
15条回答
  • 2020-12-08 20:06

    A solution that worked for me was changing your test target's inherit attribute in your Podfile from :search_paths to :complete. Although this answer suggests that :search_paths is designed for test environments.

    target 'myapp' do    
      use_frameworks!
    
      target 'myappTests' do
        #inherit! :search_paths
        inherit! :complete
      end
    
    end
    
    0 讨论(0)
  • 2020-12-08 20:10

    I have same issue is because i add a new file into the framework. So just run "pod install" solved my issue. But make sure your pod under Tests target too.

    0 讨论(0)
  • 2020-12-08 20:10

    Just for the ones that came up with the same issue:

    Check on the lateral right menu which has to look like that:

    And has not have to look like that:

    0 讨论(0)
  • 2020-12-08 20:12

    In my main Target's "Link Binary With Libraries" (under Build Phases), it was the testing framework I was using (Nimble.framework) that was causing the problem. Removed it, and everything's fine!

    0 讨论(0)
  • 2020-12-08 20:15

    The problem here is that, according to the dyld error message you posted, your application is linking against XCTest.framework. That's incorrect; only your test bundle needs to link against XCTest.framework since only your test bundle contains tests.

    0 讨论(0)
  • 2020-12-08 20:17

    I had similar problem with OCMock library and solution is:

    target :"Application Tests", :exclusive => true do
        pod 'OCMock'
    end
    
    0 讨论(0)
提交回复
热议问题