Skip to content

Upgrading to version 0.6.2 compilation failed. #482

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

Closed
Junzz0 opened this issue Feb 11, 2025 · 10 comments
Closed

Upgrading to version 0.6.2 compilation failed. #482

Junzz0 opened this issue Feb 11, 2025 · 10 comments

Comments

@Junzz0
Copy link

Junzz0 commented Feb 11, 2025

Unresolved reference 'datetime'.

If you switch kotlinx-datetime to kotlinx-datetime-jvm in commonMain, it will run successfully.

androidGradlePlugin = "8.8.0"
composeMultiplatform(Android+Desktop) = "1.7.3"
kotlin = "2.1.10"
gradle = 8.12.1

@Junzz0
Copy link
Author

Junzz0 commented Feb 11, 2025

Image

removed in version 0.6.2 org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.6.2

@dkhalanskyjb
Copy link
Collaborator

kotlinx-datetime-jvm 0.6.2 was published: https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-datetime-jvm/0.6.2/ as was kotlinx-datetime: https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-datetime/0.6.2/
Could you provide a project where the issue reproduces?

@Junzz0
Copy link
Author

Junzz0 commented Feb 12, 2025

@dkhalanskyjb I just tried it:

  1. from https://kmp.jetbrains.com/ Select Android and Desktop DOWNLOAD;
  2. commonMain.dependencies add implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")

run will report Unresolved reference 'datetime'.

@dkhalanskyjb
Copy link
Collaborator

Could not reproduce: after following your instructions (and also adding some code that uses kotlinx-datetime to commonMain and desktopMain), I still get the application to run by calling ./gradlew run in the console.

@Junzz0
Copy link
Author

Junzz0 commented Feb 12, 2025

@dkhalanskyjb I tried again, only modifying gradle=8.12.1, and it still got an error.

IDE = IntelliJ IDEA Community 2024.3.2.2

That might be an issue with my development environment😁

@dkhalanskyjb
Copy link
Collaborator

Does running the application from the console succeed? If it's just an IDE error, then it should be reported to the IDE team at https://kotl.in/issue .

@Junzz0
Copy link
Author

Junzz0 commented Feb 12, 2025

And I reported it CMP-7438 has a similar issue, I'll check back if I can upgrade to a new CMP version in the future😁

@Junzz0
Copy link
Author

Junzz0 commented Feb 12, 2025

Does running the application from the console succeed? If it's just an IDE error, then it should be reported to the IDE team at https://kotl.in/issue .

Welcome to Gradle 8.12.1!

Here are the highlights of this release:

  • Enhanced error and warning reporting with the Problems API
  • File-system watching support on Alpine Linux
  • Build and test Swift 6 libraries and apps

For more details see https://docs.gradle.org/8.12.1/release-notes.html

Type-safe project accessors is an incubating feature.

Task :composeApp:compileKotlinDesktop FAILED
e: file:///var/home/IdeaProjects/KotlinProject/composeApp/src/commonMain/kotlin/org/example/project/App.kt:18:16 Unresolved reference 'datetime'.
e: file:///var/home/IdeaProjects/KotlinProject/composeApp/src/commonMain/kotlin/org/example/project/App.kt:27:35 Unresolved reference 'Clock'.

[Incubating] Problems report is available at: file:///var/home/IdeaProjects/KotlinProject/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':composeApp:compileKotlinDesktop'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.12.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1s
9 actionable tasks: 1 executed, 8 up-to-date

@dkhalanskyjb
Copy link
Collaborator

If you send me a zip archive with the project where this happens, I'll check to see if it runs on my machine.
What you can also attempt is to remove the .m2 and .gradle directories from the home of your user. It could be that something got cached incorrectly.

@Junzz0
Copy link
Author

Junzz0 commented Feb 17, 2025

@dkhalanskyjb It feels like this is an IntelliJ IDEA bug, I updated to IntelliJ IDEA 2024.3.3 and the update was successful. 👍🏼
https://blog.jetbrains.com/idea/2025/02/intellij-idea-2024-3-3/

@Junzz0 Junzz0 closed this as completed Feb 17, 2025
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