-
Notifications
You must be signed in to change notification settings - Fork 121
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
Unresolved reference error with Kotlin 2.1 and API dependencies #875
Comments
Could you share a project that reproduces it? |
Sure, here is a reproduction repository: https://github.com/vinceglb/MavenPublishExample You can visit Also, you can run one of these commands to have errors at build time: ./gradlew build
./gradlew :lib-c:compileCommonMainKotlinMetadata If you remove all the plugin properties bellow Also, if you keep properties in |
Thank you for the reproducer, it helped a lot. I was able to narrow it down to the |
Thanks a lot for your reactivity! I'll follow the issue on YouTrack. |
After upgrading my library from Kotlin 2.0.21 to 2.1.0, my build broke. After some investigation, I realized that the plugin was breaking the build in a specific case: when using api dependencies. Here is the setup:
Library root
gradle/libs.versions.toml
Then, configure the POM as described here: https://vanniktech.github.io/gradle-maven-publish-plugin/central/#configuring-maven-central
gradle.properties
Package lib-a
LibA.kt
Package lib-b
build.gradle.kts
Package lib-c
build.gradle.kts
main.kt
I realized that:
gradle.properties
, even when using Kotlin 2.1, it fixes the build with no more unresolved reference error.If you have any questions, don't hesitate!
The text was updated successfully, but these errors were encountered: