Ld: Framework not found for i386 architecture

I am trying to test a method in my structure and I wrote a simple test case. But it fails, and xcode gives me an error:

ld: framework not found V***ments for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

I double-checked that the framework was added to the built-in binary, as well as to the assembly phase section.

Here is my test file:

 import XCTest @testable import MYClass class MYClassTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } func testInitalization() { // tests pass when I comment the following lines. // let one = MYClass.sharedInstance // XCTAssertNotNil(one, "Failed to create a MYClass instance") } } 

When I uncomment these two lines, I get a Framework error that was not found.

I also tried the following methods:

  • The frame is added to the Embedded binaries section.
  • Embeddable contains fast code installed in YES , since the environment contains fast code.
  • The executable prefix in the "Packaging" section is empty. (It is not installed in @ executable_path / Frameworks)
  • The path to find the path when linking is set to

    $ (inherited) @ executable_path / Wireframes @ Loader_path / Wireframes

  • I also tried to clean up the project and restart xcode and create a framework.

  • Remote derived data.

I am not sure what the problem is. Any ideas?

+5
source share

Source: https://habr.com/ru/post/1240382/


All Articles