Need help with Kotlin Multiplatform iOS build issu...
# multiplatform
s
Need help with Kotlin Multiplatform iOS build issue I’m running into a problem when building our KMP project, specifically with the task
Copy code
:composeApp:compileKotlinIosSimulatorArm64.
Instead of generating a .klib file at:
Copy code
compose App/build/classes/kotlin/ios Simulator Arm64/main/lib/compose App
the build consistently creates a directory named composeApp/ (inside it there’s a default/ folder and other files). As a result, the build fails with:
Copy code
java.io.FileNotFoundException: ...compose App (Is a directory)
- kotlin: 2.1.21, cmp: 1.7.3 Has anyone seen this behavior where a .klib is expected but a directory is created instead? Any ideas what might be causing this or how to debug it further? Appreciate any pointers 🙏
t
directory is expected for this task. What is your compilation problem exactly? Could you share a Gradle build scan? Or full stacktrace?
s
when i'm trying to launch ios application, i'm getting this error:
Copy code
❌ /.../composeApp/build/classes/kotlin/iosSimulatorArm64/main/klib/composeApp (Is a directory)
❌ /.../composeApp/build/classes/kotlin/iosSimulatorArm64/main/klib/composeApp (Is a directory)
[Incubating] Problems report is available at: file:///.../build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':composeApp:compileKotlinIosSimulatorArm64'.
> java.io.FileNotFoundException: /.../composeApp/build/classes/kotlin/iosSimulatorArm64/main/klib/composeApp (Is a directory)
t
Could you share the full stacktrace?
s
logs.txt
t
could you add
--stacktrace
to Gradle invocation and share the produced stacktrace?
Or parametrize through `gradle.properties`:
Copy code
org.gradle.logging.stacktrace=always
s
logstacktrace.txt
t
Cause:
Copy code
Caused by: java.io.FileNotFoundException: /Users/radchenko/AndroidStudioProjects/Effective-Office/composeApp/build/classes/kotlin/iosSimulatorArm64/main/klib/composeApp (Is a directory)
        at dev.icerock.gradle.utils.ZipUtilsKt.unzipTo(ZipUtils.kt:14)
        at dev.icerock.gradle.actions.apple.PackAppleResourcesToKLibAction.execute(PackAppleResourcesToKLibAction.kt:50)
        at dev.icerock.gradle.actions.apple.PackAppleResourcesToKLibAction.execute(PackAppleResourcesToKLibAction.kt:19)
I suppose you need to update
moko-resources
to
0.24.5
release: https://github.com/icerockdev/moko-resources/releases/tag/release%2F0.24.5
s
I tried it, but I updated the dependency, not the plugin itself. This fixed the problem, thanks!
👍 1