Failed to load native library:libjansi.jnilib.
Describe the bug In Fleet when i run ios project, it gives me following error:
Failed to load native library:libjansi.jnilib. The native library file at /Users/mohammad/.gradle/native/jansi/1.18/osx/libjansi.jnilib is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location. osinfo: Mac/arm64
java.lang.UnsatisfiedLinkError: Can't load library: /Users/mohammad/.gradle/native/jansi/1.18/osx/libjansi.jnilib
Also i add kotlin.native.disableCompilerDaemon = true to gradle.properties.
Affected platforms
- iOS
Versions
- Libraries:
- Compose Multiplatform version: 1.6.11
- Kotlin version: 2.0.0
- OS version(s) (required for Desktop and iOS issues): IOS
- OS architecture (x86 or arm64): arm64
- Device (model or simulator for iOS issues): iphone 15
Could you try to run your app in Xcode? It seems like the Fleet issue: https://youtrack.jetbrains.com/issues/FL
If it's not then provide a reproducer, please.
I have the same log after adding Room to the project. It looks like an informational log so i'm just ignoring it. This doesn't seem to be a Compose problem. And i use Android Studio so this is not a Fleet issue too
I have the same error with Room configuration, and I solved with:
kotlin{
sourceSets.iosMain {
kotlin.srcDir("build/generated/ksp/metadata")
}
...
}
// Room configuration to generate metadata files
room {
schemaDirectory("$projectDir/schemas")
}
dependencies {
add("kspCommonMainMetadata", libs.room.compiler)
add("kspAndroid", libs.room.compiler)
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach {
if (name != "kspCommonMainKotlinMetadata") {
dependsOn("kspCommonMainKotlinMetadata")
}
}
I'm seeing this as well. This is what I see:
Failed to load native library:libjansi.jnilib. The native library file at /Users/sterling/.gradle/native/jansi/1.18/osx/libjansi.jnilib is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location. osinfo: Mac/arm64
java.lang.UnsatisfiedLinkError: /Users/sterling/.gradle/native/jansi/1.18/osx/libjansi.jnilib: dlopen(/Users/sterling/.gradle/native/jansi/1.18/osx/libjansi.jnilib, 0x0001): tried: '/Users/sterling/.gradle/native/jansi/1.18/osx/libjansi.jnilib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/sterling/.gradle/native/jansi/1.18/osx/libjansi.jnilib' (no such file), '/Users/sterling/.gradle/native/jansi/1.18/osx/libjansi.jnilib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
I've got ktor and Room in my project but not sure it's related to them. I tried to add the solution above to my project but no change. I haven't see this in my other projects. It doesn't seem to block me from building or running my project. I'm using an M1 mac.
I've got Room and Kotlin2 in my project. (Kotlin 1.9.24 is ok) https://github.com/JetBrains/compose-multiplatform/issues/4928#issuecomment-2166540240
I've got Room and Kotlin2 in my project. (Kotlin 1.9.24 is ok) #4928 (comment)
ok yeah i have the same...I thought maybe I started to see it when I added Room. haven't tried 1.9.24 but I can probably try that out to check what happens.
Im also having the same problem. Room is my only dependency. I cannot find a good example of how to add the dependency to a project that has been created with the KMM wizard, so I might have done something wrong.
I've reported the same issue for Kotlin without Compose + a link to a reproducer https://youtrack.jetbrains.com/issue/KT-69523
As I see the problem is Room specific, and the compose multiplatform is not the reason
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
I have the same error with Room configuration, and I solved with:
kotlin{ sourceSets.iosMain { kotlin.srcDir("build/generated/ksp/metadata") } ... }// Room configuration to generate metadata files room { schemaDirectory("$projectDir/schemas") } dependencies { add("kspCommonMainMetadata", libs.room.compiler) add("kspAndroid", libs.room.compiler) } tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach { if (name != "kspCommonMainKotlinMetadata") { dependsOn("kspCommonMainKotlinMetadata") } }
worked like a charm