I’ve been working on a Kotlin Multiplatform Mobile (KMM) project and have successfully shared common code between an Android app in Android Studio and an iOS app in Xcode. However, I’m facing an issue when trying to integrate this shared code into an iOS static library in Xcode and then accessing it from another project.
Here are the steps I’ve taken:
- Created a KMM project with shared common code.
- Successfully accessed and used this code in the Android app (in Android Studio) and iOS app (in Xcode).
- Created an iOS static library from Xcode to encapsulate the shared code.
- Attempted to integrate this static library into another Xcode project.
The problem is that I cannot seem to access the shared code within the iOS static library from the other Xcode project.
Here’s what I’ve tried:
- Checked that the shared code is correctly included in the static library target.
- Verified that the library is correctly linked in the other Xcode project.
- Ensured that the shared code is marked as “Public” in the static library’s build settings.
- Double-checked the import statements and namespaces.
Steps for generating the static library
(Is this the correct way to generate the static library for KMM project or am I missing anything)
My question is:
What could be causing this issue, and how can I successfully access the shared Kotlin Multiplatform Mobile (KMM) code from an iOS static library in another Xcode project?
Thank you for your help!