Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to execute kotlin native packaging #397

Closed
selcarpa opened this issue May 21, 2024 · 5 comments
Closed

Unable to execute kotlin native packaging #397

selcarpa opened this issue May 21, 2024 · 5 comments

Comments

@selcarpa
Copy link

After I upgraded my project from 0.5.0 to 0.6.0, the linuxX64MainBinaries of kotlin multiplatform cannot be executed correctly.
Here is logs

2024-05-21T10:09:33.544+0800 [ERROR] [system.err] e: Could not find "org.jetbrains.kotlinx:kotlinx-datetime-cinterop-date" in [/home/sel/repository/selcarpa/cloudflare-ddns, /home/sel/.konan/klib, /home/sel/.konan/kotlin-native-prebuilt-linux-x86_64-1.9.24/klib/common, /home/sel/.konan/kotlin-native-prebuilt-linux-x86_64-1.9.24/klib/platform/linux_x64]
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':compileKotlinLinuxX64'.
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Compilation finished with errors
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --stacktrace option to get the stack trace.
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --scan to get full insights.
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
2024-05-21T10:09:33.558+0800 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 430ms
10:09:33 AM: Execution finished 'linuxX64MainBinaries --debug'.
@dkhalanskyjb
Copy link
Collaborator

Nothing in the library mentions kotlinx-datetime-cinterop-date, it's an internal piece of implementation that is no longer used. If you provide a project where the issue reproduces, we'll look into it, but as is, this looks like some incremental compilation or caching problem. A clean bulid may help.

@selcarpa
Copy link
Author

You are right, the "tomlkt" library in my project references "org.jetbrains.kotlinx:kotlinx-datetime:0.5.0", and for some reason this causes a packaging error for me. In a clean project, it does not Come out with this

@dkhalanskyjb
Copy link
Collaborator

Huh, strange. Still, the error message you've shown seems unhelpful and could possibly be improved, so if you provide a project where this error message reproduces (even if with third-party libraries), this could help us improve the tools.

@selcarpa
Copy link
Author

Thank you for your attention. This is the smallest repository that can reproduce the error.

compile_error_demo_1

jvm target everything is normal

./gradlew jvmJar

But linuxX64MainBinaries will reproduce the above error

./gradlew linuxX64MainBinaries

@dkhalanskyjb
Copy link
Collaborator

Thanks! Can confirm that, with your project, the problem reproduces for me as well. Filed an issue: https://youtrack.jetbrains.com/issue/KT-68411/Projects-depending-on-Kotlin-Native-libraries-transitively-depend-on-the-internal-cinterop-implementations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants