SKIE: Error making xcframework build
Here is a snippet of code for what we use to build our xcframework
kotlinArtifacts {
Native.XCFramework("SharedNetwork") {
targets(iosX64, iosArm64, iosSimulatorArm64)
setModules(...
it is the experimental kotlin artifact: https://kotlinlang.org/docs/multiplatform-native-artifacts.html#xcframeworks
we start the build by running ./gradlew assembleSharedNetworkXCFramework
and we get this error
> Task :shared:data:network:assembleDebugIosSimulatorFatFrameworkForSharedNetworkXCFramework FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared:data:network:assembleDebugIosSimulatorFatFrameworkForSharedNetworkXCFramework'.
> java.io.FileNotFoundException: /Users/hfg/Documents/android/shared/data/network/build/SharedNetworkXCFrameworkTemp/ios_x64/debug/SharedNetwork.framework/Headers/SharedNetwork-Swift.h (No such file or directory)
From following your installation guide, the only thing we did was
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization") version "1.9.10"
id("com.android.library")
id("co.touchlab.crashkios.crashlyticslink") version "0.8.2"
id("co.touchlab.skie") version "latest.release" //<-- here we add skie plugin
}
This error during building has only happened since adding the skie plugin.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (5 by maintainers)
This is definitely something that we’ll fix in SKIE so it doesn’t fail when nothing is produced.
@findjigar provided me with a reproducer project and we were able to verify it’s what @FilipDolnik mentioned. When there are no Swift files generated or bundled by SKIE, you’ll see this error happen. It’s a bug in SKIE where it should check for the file’s presence before trying to copy it. For now you can disable SKIE using
skie.isEnabled = falseinbuild.gradle.kts, or give SKIE anything to do like declaring a public global function in the Kotlin sources. That way SKIE generates at least one Swift source file and Swift compiler then creates the-Swift.hheader file.For example: https://kotlinlang.org/docs/multiplatform-build-native-binaries.html#build-xcframeworks
We have a reproducer and are actively working on a fix.
The problem is that SKIE doesn’t yet support the new syntax for declaring XCFrameworks (so if you want to try SKIE before this fix is released, you can revert to the old syntax).