Ensure the iOS framework is found by my iOS static library code
I'm building an iOS static library (i.e. a .a file) which I include in the Assets/Plugins/iOS folder of my Unity project so that the Mono C# scripts attached to my Unity scene objects can call functions in the iOS static library.
The static library makes calls into a Swift framework. It is not a standard Apple framework, but one I wrote. This is fairly straightforward, I just need to @import
the framework in the Objective-C .m file where the framework is used.
But to include the framework in the Xcode project built by Unity for iOS I need to add the framework file to that Assets/Plugins/iOS folder of my Unity project. This presents a problem. In the Xcode project that Unity writes as part of the build process it puts my static library, the .a file, into Libraries/Plugins/iOS
and it puts the framework file into Frameworks/Plugins/iOS
and it nests them that way in the Xcode project structure itself:
When I run the project it crashes when my static library code tries to access the framework:
dyld: Library not loaded: >@rpath/IOSPluginTestFramework.framework/IOSPluginTestFramework
Referenced from: /var/containers/Bundle/Application/C62F676F-CC52-414F-B996-D46C82ECC29A/ProductName.app/ProductName
Reason: image not found
(lldb)
How do I get Unity to ensure the framework is found by my static library code?
Your answer
Follow this Question
Related Questions
Unity IAP: Problem when submitting to iOS App Review. 1 Answer
iOS SocialPlatforms - IPv6 Support 1 Answer
Custom Outline Shader acting weird on iOS builds. 1 Answer
iOS Crash in UnityUpdateDisplayList (2017.3.0f3) - Rejection by Apple 9 Answers
I can't zoom by pinching in the running App but i can in Unity Remote 5 0 Answers