Search code examples
swiftxcodecocoacocoapodsstatic-libraries

How to correctly change dynamic pod library to static?


The third party library began to support only the static cocoapods library. Before that, it was connected as dynamic

After changing the dynamic library to a static one, such an error began to appear

Please help me figure this out:

Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility56

ld: warning: Could not find or use auto-linked library 'swiftCompatibility56'
ld: warning: Could not find or use auto-linked framework '<Name>'
ld: warning: Could not find or use auto-linked framework '<Name>'
ld: warning: Could not find or use auto-linked framework '<Name>'
Undefined symbols for architecture arm64:
  "__swift_FORCE_LOAD_$_swiftCompatibility56", referenced from:
      __swift_FORCE_LOAD_$_swiftCompatibility56_$_<someName> in <ThirdPartyLibrary>.a(File.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$<ThirdPartyLibrary> in <ThirdPartyLibrary>.a(File.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$<ThirdPartyLibrary> in <ThirdPartyLibrary>.a(File.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$<ThirdPartyLibrary> in <ThirdPartyLibrary>.a(File.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$<ThirdPartyLibrary> in <ThirdPartyLibrary>.a(File.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$<ThirdPartyLibrary> in <ThirdPartyLibrary>.a(File.o)
      __swift_FORCE_LOAD_$_swiftCompatibility56_$<ThirdPartyLibrary> in <ThirdPartyLibrary>.a(File.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility56_$_<ThirdPartyLibrary>, __swift_FORCE_LOAD_$_swiftCompatibility56_$_<ThirdPartyLibrary> , __swift_FORCE_LOAD_$_swiftCompatibility56_$_<ThirdPartyLibrary> )
ld: symbol(s) not found for architecture arm64

P.S. My podfile doesn't contain line use_frameworks!

I have Xcode 14.2


Solution

  • Actually, it was a problem with Xcode 14.2 The vendor's library now supports the minimum version of Xcode 14.3, and I built the application on Xcode 14.2

    If you had this problem, you should update your Xcode to 14.3