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

Module kotlinx.serialization.core not found in module graph #496

Open
05nelsonm opened this issue Mar 3, 2025 · 2 comments · May be fixed by #507
Open

Module kotlinx.serialization.core not found in module graph #496

05nelsonm opened this issue Mar 3, 2025 · 2 comments · May be fixed by #507
Labels
bug Something isn't working
Milestone

Comments

@05nelsonm
Copy link

kotlinx-datetime:core uses transitive static when expressing kotlinx.serialization.core in its module-info.java. This results in a compilation error for library consumers who do not have kotlinx.serialization.core as a dependency, but are also supporting JPMS.

> Task :{project-name}:compileKotlinJvm FAILED
e: Module kotlinx.serialization.core cannot be found in the module graph

I believe dropping the key word transitive (because kotlinx.serialization.core is not defined in kotlinx-datetime:core as an api dependency) would fix the issue.

@hfhbd
Copy link
Contributor

hfhbd commented Mar 31, 2025

kotlinx-serialization-core is an compileOnly dependency, so it should be mapped to requires static according to https://docs.gradle.org/current/userguide/java_library_plugin.html#declaring_module_dependencies.

@dkhalanskyjb
Copy link
Collaborator

https://stackoverflow.com/questions/77644309/are-jpms-modifiers-static-and-transitive-incompatible does also reach the conclusion that transitive and static are incompatible. Though in general, the information on requires transitive static on the Web is somewhat scarce.

@dkhalanskyjb dkhalanskyjb added the bug Something isn't working label Apr 9, 2025
@dkhalanskyjb dkhalanskyjb added this to the 0.7.0 milestone Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants