Xcode 12 HaishinKit lib build error: Undefined symbols for architecture x86_64

Viewed 2629

Can't build the project after installing a pod: (it was ok on Xcode 11 [https://github.com/shogo4405/HaishinKit.swift][1]

  "__swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers", referenced from:
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_HaishinKit in libHaishinKit.a(ASClass.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_HaishinKit in libHaishinKit.a(AVRecorder.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_HaishinKit in libHaishinKit.a(GLHKView.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_HaishinKit in libHaishinKit.a(HTTPService.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_HaishinKit in libHaishinKit.a(IOComponent.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_HaishinKit in libHaishinKit.a(AudioIOComponent.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_HaishinKit in libHaishinKit.a(MTHKView.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_HaishinKit)
  "__swift_FORCE_LOAD_$_swiftCoreMIDI", referenced from:
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_HaishinKit in libHaishinKit.a(ASClass.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_HaishinKit in libHaishinKit.a(AVRecorder.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_HaishinKit in libHaishinKit.a(GLHKView.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_HaishinKit in libHaishinKit.a(HTTPService.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_HaishinKit in libHaishinKit.a(IOComponent.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_HaishinKit in libHaishinKit.a(AudioIOComponent.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_HaishinKit in libHaishinKit.a(MTHKView.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreMIDI_$_HaishinKit)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)```


  [1]: https://github.com/shogo4405/HaishinKit.swift
1 Answers

Creating a new empty Swift file using Xcode in the project worked for me. I don't really know why but Xcode fixes everything.

Related