Hello,
I have a Unity project that uses a native Swift + ObjC library that I made using Firebase MLKit. When trying to build for iOS, the Unity project always builds with Xcode 11.3.1, but when updating to any Xcode 12.X version, I get the following errors :
ld: warning: Could not find or use
auto-linked library ‘swiftCoreMIDI’
ld: warning: Could not find or use
auto-linked library
‘swiftUniformTypeIdentifiers’
Undefined symbols for architecture
armv7:
“_swift_FORCE_LOAD_swiftUniformTypeIdentifiers", referenced from: __swift_FORCE_LOAD_swiftUniformTypeIdentifiers_NativeLibrary_iOS in NativeLibrary_iOS.a(NativeLibrary.o) __swift_FORCE_LOAD_swiftUniformTypeIdentifiers_NativeLibrary_iOS in NativeLibrary_iOS.a(UIImage.o) (maybe you meant: __swift_FORCE_LOAD_swiftUniformTypeIdentifiers_NativeLibrary_iOS) "__swift_FORCE_LOAD__swiftCoreMIDI”,
referenced from:
_swift_FORCE_LOAD_swiftCoreMIDI__NativeLibrary_iOS
in
NativeLibrary_iOS.a(NativeLibrary.o)
_swift_FORCE_LOAD_swiftCoreMIDI__NativeLibrary_iOS
in NativeLibrary_iOS.a(UIImage.o)
(maybe you meant: _swift_FORCE_LOAD_swiftCoreMIDI__NativeLibrary_iOS)
ld: symbol(s) not found for
architecture armv7 clang: error:
linker command failed with exit code 1
(use -v to see invocation)
I am not using either swiftCoreMIDI nor swiftUniformTypeIdentifiers in my code. For the record, I did recompile my native library with Xcode 12 before importing it again in Unity.
Things I have tried:
- Building a Unity project with a Swift library that doesn’t use Firebase MLKit : works fine
- Building an Xcode only project that uses Firebase MLKit : works fine
- Building the project with a more recent Unity version : fails
- Integrating the Firebase SDK frameworks directly instead of using CocoaPods : fails
- Adding an empty Swift file + bridging header to my project : fails
- Adding the user defined setting LD_VERIFY_BITCODE = NO in XCode : fails
I’m using:
- Xcode 12.2
- Firebase 6.34
- Swift 5.0
- Unity 2019.3.6f1
Any help would be appreciated, I’ve been stuck on this for a while!