I'm getting No 'swiftinterface' error when applyin...
# touchlab-tools
s
I'm getting No 'swiftinterface' error when applying SKIE 0.7. It builds fine with 0.64 though.
Copy code
> Task :core:assembleMarbleSharedReleaseXCFramework FAILED
No 'swiftinterface' files found within '/Users/<>/build/bin/iosArm64/releaseFramework/ProjectNameShared.framework/Modules/ProjectNameShared.swiftmodule'.
Copy code
> Task :core:linkReleaseFrameworkIosArm64
w: 'var ProjectNameShared.Ktor_httpHttpStatusCode.description' was renamed to 'var ProjectNameShared.Ktor_httpHttpStatusCode.description_' because of a name collision with an another declaration 'func ProjectNameShared.KotlinBase.description() -> Swift.String'. Consider resolving the conflict either by changing the name in Kotlin, or via the @ObjCName annotation. You can also suppress this warning using the 'SuppressSkieWarning.NameCollision' configuration. However using renamed declarations from Swift is not recommended because their name will change if the conflict is resolved.
    (at val description: String defined in io.ktor.http.HttpStatusCode)

> Task :core:linkReleaseFrameworkIosSimulatorArm64
w: 'var ProjectNameShared.Ktor_httpHttpStatusCode.description' was renamed to 'var ProjectNameShared.Ktor_httpHttpStatusCode.description_' because of a name collision with an another declaration 'func ProjectNameShared.KotlinBase.description() -> Swift.String'. Consider resolving the conflict either by changing the name in Kotlin, or via the @ObjCName annotation. You can also suppress this warning using the 'SuppressSkieWarning.NameCollision' configuration. However using renamed declarations from Swift is not recommended because their name will change if the conflict is resolved.
    (at val description: String defined in io.ktor.http.HttpStatusCode)

> Task :core:assembleProjectNameSharedReleaseXCFramework FAILED
No 'swiftinterface' files found within '/Users/<>/build/bin/iosArm64/releaseFramework/ProjectNameShared.framework/Modules/ProjectNameShared.swiftmodule'.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':core:assembleProjectNameSharedReleaseXCFramework'.
> Process 'command 'xcodebuild'' finished with non-zero exit value 70
f
Just to confirm what the issue is, can you try adding the following configuration to Gradle?
Copy code
skie {
    build {
        enableSwiftLibraryEvolution.set(true)
    }
}
s
sure
@Filip Dolník enabling this solved the issue. thanks.
f
I would call it a workaround 😄 Can you please share the part of your Gradle configuration where you create the XcFramework + kotlin block?
s
Gradle Configuration is across multiple files with convention plugins, these are the two places where there is configuration for kotlin block
f
Thanks! I will try to reproduce it.
s
sure, thanks again.
d
I’m running into the same issue, and I was able to successfully apply the workaround too (thank you!). Here’s where we configure the XCFramework (unrelated config stripped out):
Copy code
kotlin {
    jvmToolchain(11)

    val xcfName = "Redacted"
    val xcf = XCFramework(xcfName)

    listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach {
        it.binaries.framework {
            binaryOption("bundleId", "red.act.ed")

            baseName = xcfName
            xcf.add(this)

            export(projects.data)
            export(projects.domain)
            export(projects.presentation)
        }
    }
}
f
Yeah, I have a reproducer. Now to figure out how this got through our Gradle tests 😄
🧑‍🔬 3
Working on a fix. Hopefully will be available tomorrow. Until then you can use the workaround which explicitly enables library evolution. Make sure to remove the workaround after the fix (unless you explicitly want to have library evolution enabled).
🙏 2
l
Interesting! I thought the new build setting was required based on this line from the release notes:
The only exception is when building XCFrameworks, which require the library evolution to be enabled.
d
In general, library evolution is required if you’re going to mix Swift compiler versions (use a different compiler for the XCFramework and the iOS app). If library evolution is not enabled, an error shows up when trying to link the XCFramework to the app if the compiler versions aren’t compatible, but that error that we’ve been seeing was emitted during the compilation of the XCFramework already.
f
Yeah, based on my understanding you currently cannot build XCFramework without library evolution (because it requires the
swiftinterface
file) For this reason SKIE automatically enables it and the bug is in the auto detection that is supposed to enable it (it works for the newer Artifact APIs but not for the original API because we accidentally didn’t have a test for it 😄).
💡 1
SKIE 0.7.1 was just released with a bug fix for this issue. Equivalent bug fix for the K2 preview will be released later today.
🙌 1
thank you color 3
🦸 1
s
thanks @Filip Dolník
f
The associated K2 preview (
0.7.1-preview.2.0.0-RC3
) is now also public.
b
Hey folks, I’m experiencing this same issue using the latest SKIE version
f
Hi! Does explicitly enabling the library evolution fix the issue in this case as well?
Copy code
skie {
    build {
        enableSwiftLibraryEvolution.set(true)
    }
}
b
I just tried the workaround and it's still happening
f
Ok, so it must be a different bug, just with the same error message. Please create an issue here https://github.com/touchlab/SKIE/issues and include your Gradle configuration and all the other relevant information.
z
@Filip Dolník Sorry for tagging you, but I get the same error while using SKIE 0.9.2? When I add
Copy code
skie {
    build {
        enableSwiftLibraryEvolution.set(true)
    }
}
the issue is gone. But as you said, it is a workaround, so I would like to solve this issue properly.
f
Hi! Please open a new issue https://github.com/touchlab/SKIE/issues. It seems this error message can be caused by several different things.
j
We had the same, so I opened an issue for it. https://github.com/touchlab/SKIE/issues/124
120 Views