Test bundle could not be loaded because an unanticipated error

后端 未结 10 1474
盖世英雄少女心
盖世英雄少女心 2020-12-31 00:57

Recently I have started writing test case for one old static library. I have loaded the library to Xcode 5,Since Static Library is old , I have to manually add TestProject w

相关标签:
10条回答
  • 2020-12-31 01:40

    I found the answer by myself.

    Your Build Settings -> Architectures should be same for Library and Test Project

    Architectures -> Architectures = Standrad Architectures (armv7 ,armv7s , arm64)$(ARCHS_STANDARD)

    Your Test Project's Linking -> Mach-O Type should be Bundle

    Linking -> Mach-O Type = Bundle

    Do Build and Run Tests. Thats it

    0 讨论(0)
  • 2020-12-31 01:41

    For me this issue was due to the "iOS Deployment Target" Build Setting being different in my test target than my main app. Once I made them the same the problem went away.

    0 讨论(0)
  • 2020-12-31 01:42

    I had a similar problem. For me, the problem was a unit testing framework that was a dynamic framework but not copied over to the xctest bundle.

    The solution was to add a "Copy Files" phase to my unit test target, set its destination to "Frameworks" and add my framework as an input file.

    0 讨论(0)
  • 2020-12-31 01:43

    I was able to resolve this issue by setting the host application for the test target:

    0 讨论(0)
提交回复
热议问题