I'm developing a Flutter library that contains iOS native Swift code. This native code needs to call functions from an xcframework.
Currently, I can add the xcframework by manually dragging and dropping the file into Xcode.
However, the xcframework will disapear whenever I run pod install
, forcing me to re-add the xcframework each time. I have the vendored_frameworks inside the podspec as below:
s.vendored_frameworks = 'ios/path/to/your/AnotherLibrary.xcframework'
Is there a way to automatically include the xcframework in my Flutter plugin's iOS code that persists after running pod install
?
I found the root cause and solution to this problem. The issue was with the naming convention of the static library inside the xcframework.
Rename the static library from AnotherLibrary.a
to libAnotherLibrary.a
solved the issue.
The "lib" prefix is the standard naming convention for static libraries, and Xcode's linker expects this format to properly resolve and link the library.