Should SKIE work with the "Multiplatform resources...
# touchlab-tools
t
Should SKIE work with the "Multiplatform resources" functionality? I'm updating to Kotlin 2.0 and I transitioned our resources to use Multiplatform resources. I'm seeing these errors relating to the Res file.
Copy code
Showing Recent Messages
> Task :shared:linkPodDebugFrameworkIosArm64 FAILED

Cannot infer a bundle ID from packages of source files and exported dependencies, use the bundle name instead: shared. Please specify the bundle ID explicitly using the -Xbinary=bundleId=<id> compiler flag.

output:

Compilation failed: The /Applications/Xcode-15.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc command returned non-zero exit code: 1.

            shared.__SkieSuspendWrappersKt.Skie_Suspend__128__readBytes(dispatchReceiver: self, path: path, suspendHandler: $0)

            ^~~~~~

            Res.

.../shared/build/skie/binaries/podDebugFramework/DEBUG/iosArm64/swift/generated/Shared/Shared.Res.swift:10:13: static member 'shared' cannot be used on instance of type 'Res'

            shared.__SkieSuspendWrappersKt.Skie_Suspend__128__readBytes(dispatchReceiver: self, path: path, suspendHandler: $0)

            ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~

.../shared/build/skie/binaries/podDebugFramework/DEBUG/iosArm64/swift/generated/Shared/Shared.Res.swift:10:20: value of type 'Res' has no member '__SkieSuspendWrappersKt'

            shared.__SkieSuspendWrappersKt.Skie_Suspend__5__execute(dispatchReceiver: __kotlinObject as! shared.Ktor_utilsPipeline<Swift.AnyObject, Swift.AnyObject>, context: context as! Any, subject: subject as! Any, suspendHandler: $0)

                                                                                                                                                                                       ^~~

                                                                                                                                                                                       as

.../shared/build/skie/binaries/podDebugFramework/DEBUG/iosArm64/swift/generated/KtorUtils/KtorUtils.Pipeline.swift:28:184: forced cast from 'TContext' to 'Any' always succeeds; did you mean to use 'as'?

            shared.__SkieSuspendWrappersKt.Skie_Suspend__5__execute(dispatchReceiver: __kotlinObject as! shared.Ktor_utilsPipeline<Swift.AnyObject, Swift.AnyObject>, context: context as! Any, subject: subject as! Any, suspendHandler: $0)
f
Hi! I don’t think we have tests for Multiplatform resources so it’s possible there is some bug. Can you please send over the content of the
shared/build/skie/binaries/podDebugFramework/DEBUG/iosArm64/swift/generated/Shared/Shared.Res.swift
file?
t
Copy code
// Generated by Touchlab SKIE 0.8.1

import Foundation

extension shared.Res {

    @available(iOS 13, macOS 10.15, watchOS 6, tvOS 13, *)
    public func readBytes(path: Swift.String) async throws -> shared.KotlinByteArray {
        return try await SwiftCoroutineDispatcher.dispatch {
            shared.__SkieSuspendWrappersKt.Skie_Suspend__128__readBytes(dispatchReceiver: self, path: path, suspendHandler: $0)
        }
    }

}
In case it helps to see the Xcode error I'm seeing with context.
f
yeah, this looks like a collision of the module name and a static member named
shared
workaround before we fix that is to rename the framework or to disable the SKIE suspend feature for the problematic class using the Gradle configuration
t
Can you point me to the docs on how to disable the suspend feature? Seems like that might be the easiest work around.
f
Add the correct fq name and put this into the build.gradle.kts file where you apply SKIE
Copy code
skie {
    features {
        group("${fq name of the Res class}") {
            SuspendInterop.Enabled(false)
        }
    }
}
t
Thank you
That got me past the errors. I really appreciate the help. Our team is enjoying all of the features that SKIE brings for iOS development!
161 Views