Hello guys, I am trying to integrate KMP with SKIE...
# multiplatform
t
Hello guys, I am trying to integrate KMP with SKIE and am unable to run iOS I am using
Copy code
kotlin = "2.1.0"
skie = "0.10.0"
agp = "8.8.0"
ktor = "3.0.1"
gradle-8.10.2

Xcode 16.0
Android Studio Meerkat | 2024.3.1
Error:
Copy code
The following build commands failed:
	SwiftCompile normal arm64 Compiling\ ContentView.swift /Users/user/Development/MoviesKMP/iosApp/iosApp/ContentView.swift (in target 'iosApp' from project 'iosApp')
	SwiftCompile normal arm64 /Users/user/Development/MoviesKMP/iosApp/iosApp/ContentView.swift (in target 'iosApp' from project 'iosApp')
	Building project iosApp with scheme iosApp and configuration Debug
(3 failures)
The compile issue is it cannot find the
import shared
framework. I think I have a compatibility issue. Any help is highly appreciated
t
If xcode can't find the shared module it means the native framework failed to generate. This means there was an error/exception on the kotlin side. Run ./gradlew compileKotlinIosArm64 --info This should give you more info on what caused the failure. Once this is fixed you should see the shared module on xcode
a
Also, I think you should use skie
0.10.1
for that Kotlin version
a
Hey @Tal Zion! I think that
Shared
shall be capitalized. You can get the correct module name from your
shared
gradle build file (
shared/build.gradle.kts
). See the attached image
t
Thanks guys! @Alejandro Rios I changed it back to
0.10.1
. I think I tried it before but it did not work. Not sure if this is due to
Kotlin
version. The SKIE compatibility on the website does mention up to
2.0.10
SKIE is currently compatible with Kotlin versions from 1.8.0 up to 2.0.10.
@Alex Apriamashvili I see. Ok I used the kmp wizard to generate a new project. the
baseName
is
shared
Do I need to change it to
Shared
?
Copy code
listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach {
        it.binaries.framework {
            baseName = "shared"
            isStatic = true
        }
    }
@TheArchitect123 I run
./gradlew compileKotlinIosArm64 --info
and it passes with no isses. See screenshot. 🤔 But still when I execute iOS it fails with the same error I sent
a
Thanks, Tal. In that case, keep your import lowercased. One other possible issue is the
FRAMEWORK_SEARCH_PATHS
in your build settings. It should be:
$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)
Other than that, I can't think of anything particular, other than checking if the iOS library is actually there where Xcode expects it to see.
t
I feel it might be the SKIE integration and compatibility issues When I download a template with the kmp wizard, it works fine MY environment is:
macOS 15.0.1
Xcode 16
kotlin = "2.1.0"
(comes wit the template and from the docs SKIE only supports up to
kotlin 2.0.10
) `SKIE = 0.10.1`When I add SKIE it stopped compiling I see the wizard template was updated in the last couple of weeks I'll give it a try with a new setup and see if it works
👍 1
t
@Tal Zion for SKIE support you can message #CTJB58X7X
t
Thanks man!