https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
m

Michal Klimczak

09/24/2021, 8:16 AM
I have a small but annoying issue. I have a monorepo for android and ios app and a shared module that is built into xcframework with
gradle :shared:assembleSharedDebugXCFramework
. This gradle comand is run as a Build Phase in xcode and the framework is embedded via framework search paths. Reproducing issue: 1. Change sth in shared module code. 2. Run build in xcode (takes a lot of time because xcframework is fully rebuilt). 3. The change is applied, everything fine. 4. Run build in xcode without changing anything (quick, the xcframework is not rebuilt fully). This step is crucial, without it the changes are applied just fine. 5. Change sth in shared module code again. 6. Run build in xcode (takes a lot of time because xcframework is fully rebuilt). 7. The change is not applied ‼️ 8. Run build in xcode without changing anything (quick, the xcframework is not rebuilt fully). 9. Only now the change is applied. I would rather say it's an xcode issue, but not sure. It's like in pt.7 the xcode built the framework but somehow didn't pick it yet. Only the next time. I think I had sth similar with regular frameworks and
packForXcode
but not 100% sure.
These are my build phases
it seems that the
run script
build phase is run after the framework has been already evaluated. If I remove the framework completely it will never even go to the
run script
phase to build it. Making a separate xcode target for the framework and marking it as dependency for the app target does't help as well. Any hints what's the best way to handle this?
5 Views