Hello! I migrated my KMP project to use cocoapods ...
# ios
x
Hello! I migrated my KMP project to use cocoapods integration. Now, when I build my project once in Xcode via Product -> Build, then make changes to the project and let Previews rebuild it themselves, I get the following error in some files:
Could not find module 'SchedulerKit' for target 'arm64-apple-ios'; found: arm64-apple-ios-simulator, at: /Users/Xinto/AndroidStudioProjects/Scheduler/shared/build/cocoapods/framework/SchedulerKit.framework/Modules/SchedulerKit.swiftmodule
. SchedulerKit refers to my Kotlin shared library's baseName. Looking at the generated frameworks, it really is only generating it for the simulator. Every time this error appears Xcode's autocomplete can't resolve some of the functions in my Kotlin classes. Is there anything I can do to fix this? I've tried changing "Build Active Architecture Only" in Xcode to say "NO" in Debug mode but that didn't seem to do much. Running Xcode 16.4 with Kotlin 2.3.10 on macOS 15.7.3.
f
Avoid cocoapods as it’s not a viable solution, try spmForKmp as alternative
x
Does spmForKpm support Cocoapods' linkOnly for bundling dependencies? The only reason I even switched to Cocoapods was because of Kotbase requiring CouchbaseLite runtime to be present in the final framework:
f
yes, it does! just don’t enable code exportation
x
Great!