Quick / Nimble

A Matcher Framework for Swift and Objective-C
https://quick.github.io/Nimble/documentation/nimble/
Apache License 2.0
4.8k stars 601 forks source link

Build failing on Xcode 14.3 for WatchOS (arm64, i386, x86_64) #1049

Closed kerrmarin-lvmh closed 1 year ago

kerrmarin-lvmh commented 1 year ago

What did you do?

  1. Clone this repository
  2. Open Nimble.xcodeproj
  3. Set scheme to Nimble-WatchOS
  4. Set device to "Any watchOS Simulator Device (arm64, i386, x86_64)"
  5. Product -> Build (CMD + B)

What did you expect to happen?

Nimble will build successfully

What actually happened instead?

ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/usr/lib/libXCTestSwiftSupport.dylib, file is universal (x86_64,arm64) but does not contain the i386 architecture: /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/usr/lib/libXCTestSwiftSupport.dylib
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/Library/Frameworks/XCTest.framework/XCTest, file is universal (x86_64,arm64) but does not contain the i386 architecture: /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/Library/Frameworks/XCTest.framework/XCTest
Undefined symbols for architecture i386:
  "_$s6XCTest8XCTIssueV19_bridgeToObjectiveCSoABCyF", referenced from:
      _$s6Nimble13recordFailure_8locationySS_AA14SourceLocationCtF in NimbleXCTestHandler.o
  "_$s6XCTest8XCTIssueV4type18compactDescription08detailedE017sourceCodeContext15associatedError11attachmentsACSo0B4TypeV_S2SSgSo09XCTSourcehI0Cs0K0_pSgSaySo13XCTAttachmentCGtcfC", referenced from:
      _$s6Nimble13recordFailure_8locationySS_AA14SourceLocationCtF in NimbleXCTestHandler.o
  "_$s6XCTest8XCTIssueVMa", referenced from:
      _$s6Nimble13recordFailure_8locationySS_AA14SourceLocationCtF in NimbleXCTestHandler.o
  "_OBJC_CLASS_$_XCTAttachment", referenced from:
      objc-class-ref in NimbleXCTestHandler.o
  "_OBJC_CLASS_$_XCTSourceCodeContext", referenced from:
      objc-class-ref in NimbleXCTestHandler.o
  "_OBJC_CLASS_$_XCTSourceCodeLocation", referenced from:
      objc-class-ref in NimbleXCTestHandler.o
  "_OBJC_CLASS_$_XCTestObservationCenter", referenced from:
      objc-class-ref in XCTestObservationCenter+Register.o
      __OBJC_$_CATEGORY_XCTestObservationCenter_$_Register in XCTestObservationCenter+Register.o
  "__swift_FORCE_LOAD_$_XCTestSwiftSupport", referenced from:
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_Nimble in ToSucceed.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_Nimble in ExpectationMessage.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_Nimble in NimbleEnvironment.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_Nimble in DSL+Wait.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_Nimble in BeLessThanOrEqual.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_Nimble in PostNotification.o
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_Nimble in HaveCount.o
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_Nimble)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Environment

List the software versions you're using:

Please also mention which package manager you used and its version. Delete the other package managers in this list:

This happens when building in Xcode, but also in Carthage 0.39.0

kerrmarin-lvmh commented 1 year ago

I should also mention that updating the minimum deployment to WatchOS 7.0 fixes the issue 🤷

kerrmarin commented 1 year ago

Thanks @younata !