Anybody seen an issue where iOS compiiles the sour...
# multiplatform
j
Anybody seen an issue where iOS compiiles the source (objc) code before compiling the KMP native framework for iOS? I think its just when objc references the KMP framework header. Xcode complains it can't find the header file during compilation. I have the 'Compile Kotlin Framework' build phase at the top but it doesn't run until after compiling objective-c code. this is why it can't find the header as it's not built yet.
buildPhases = (
4880793811640D66EA952C8C /* [CP] Check Pods Manifest.lock */,
9AA2DA622D08CC3200B02654 /* *Compile Kotlin Framework* */,
9ADC8B801860D7B100223C95 /* Sources */,
9ADC8B811860D7B100223C95 /* Frameworks */,
9ADC8B821860D7B100223C95 /* Resources */,
12325AA1C8CEE123D132AB83 /* [CP] Embed Pods Frameworks */,
8637450D04FA688FEB61755A /* [CP] Copy Pods Resources */,
);
figured it out, posting answer for anyone else having this issue in the future. Basically, my iOS app has multiple projects, the root project references another project which has a dependency on the KMP shared framework also. I put the build phase step to 'Compile Kotlin Framework' in the root project. Xcode builds all target dependencies first then the main project. I had to move this custom build phase script to each of the Schemes Pre Action build step. That way no matter how many projects are referencing the KMP framework, it will be generated first and only once before any targets are built.