linker command failed with exit code 1 when building Unity project in Xcode

Hi,

Im trying to build an iOS application developed with Unity. The app builds and runs just fine on Android as an apk or aab.
When building for iOS I get no errors in Unity and the Unity-iPhone.xcodeproj and Unity-iPhone.xcworkspace are built. I open the Unity-iPhone.xcworkspace and make sure the signing of the app is well and all.
But when trying to archive the project i get these errors :

(these errors appears during the building of the UnityFramework and are associated with it)

  • ld: warning: Could not find or use auto-linked library ‘swiftCoreMIDI’
  • ld: symbol(s) not found for architecture armv7
  • clang: error: linker command failed with exit code 1
  • Undefined symbol: _swiftoverride_class_getSuperclass(swift::TargetMetadata const*)
  • Undefined symbol: swift::swift51override_conformsToSwiftProtocol(swift::TargetMetadata const*, swift::TargetProtocolDescriptor const*, llvm::StringRef, swift::TargetProtocolConformanceDescriptor const* ()(swift::TargetMetadata const, swift::TargetProtocolDescriptor const*, llvm::StringRef))

Additionnal informations :

  • Im using Unity 2019.3.6f1 and I made sure to go in the iOS Resolver settings and checked the “Podfile Generation”, “Auto Install Cocoapod Tools in Editor” and “Use project settings” to true as well as setting the Cocoapods Integration to “Xcode Workspace - Add Cocoapods to the Xcode workspace
  • I also make sure to open the Unity-iPhone.xcworkspace and not the Unity-iPhone.xcodeproj.
  • I use Xcode 12.0.1 with Swift 5.3 and Im targeting iOS 10.0
  • My version of cocoapod is 1.8.4.

Things I have tried :

  • Adding the “swiftCoreMIDI” library to the list of Frameworks and Libraries and/or the list Link Binary With Libraries in the UnityFramework’s build phase.
  • Adding DEAD_CODE_STRIPPING = NO to the build settings of the target UnityFramework.
  • Installing Xcode 5.0 and using it from the toolchain menu of Xcode to build.
  • In Unity’s player settings, setting the Architecture to Universal, ARM64 and ARMv7.
  • Using “Symlink Unity libraries” in Unity’s build options
  • Reduce/Increase the build target to 8.0 / 12.0
  • And many other things that I cant recall at the moment… (been stuck on this for days)

As I understand the problem is that a library inside the UnityFramework is trying to call some functions in the “swiftCoreMIDI” library but cannot access them. But i cant figure out why adding the library to the list of Frameworks and Libraries in the general panel and/or the list Link Binary With Libraries in the UnityFramework’s build phase doesnt solve the problem.

Thanks in advance for any ideas or suggestions.

Hi, I know it’s been 8 months, but I’m in a similar situation. Did you find any answer for solving your problem?,Hi, I know it’s been 8 months, but I’m in a similar situation. Did you find any solution for this problem?