Why compileKotlin can't find dependencies

Github

I’m including two module from files by gradle



But I can’t use the functions from it.

There is the error

> Task :compileKotlin FAILED
e: E:\Sponge\sponge-template\src\main\kotlin\org\example\spongetemplate\SpongeTemplate.kt: (4, 36): Unresolved reference: registerListener
e: E:\Sponge\sponge-template\src\main\kotlin\org\example\spongetemplate\SpongeTemplate.kt: (14, 25): Unresolved reference: registerListener

I can’t check out your project https://github.com/SettingDust/sponge-template/tree/kotlin-laven: laven-sponge is an empty directory.

It’s a git submodule. Not empty. Try to run git submodule update --init --recursive?

Thank you, reproduced. When I remove mentions of publishing, shadowJar, jar in laven-sponge build file, the project starts to build. Looks like this is not Kotlin-related, maybe a shadowing issue.

Is it a issue caused by the shadow in submodule?

I think so. Try to remove shadowing from the build file.

Alright. Thanks a lot

Fixed by https://github.com/SettingDust/laven-sponge/commit/0f85149b67e8756a1c6709e5ecb85469fd9cb1be#diff-c197962302397baf3a4cc36463dce5eaL93-L96