Gradle issue w/ multi module projects - Needing help.
Hey,
I currently have a multi-module gradle project that I develop with in IntelliJ, and I'm having some downright confusing issues with unresolved classes from other modules.
For example -> Depending on my "common" module in my paper module and any classes cannot be resolved.
If you have the chance, please clone the
refactor
branch of https://github.com/TerraByteDev/SkyFactionsReborn/tree/refactor, and open it up in IntelliJ (this has happened on both Ultimate and Community).
Wait for Gradle to sync and then head to anywhere in the paper module e.g. the main SkyFactionsReborn javaplugin class, and confirm whether you have the same issue.
If you do, please figure out what the fuck I'm doing wrong. I've looked at ALL of my gradle files and nothing is wrong afaik.
The only temporary fix I know of is to run ./gradlew idea
, then delete the .idea folder and reopen the project.
You have to skip gradle sync. It is only a temporary fix and breaks hotswap.29 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by skullians#0
I was willing to live with this until I found out it broke hotswap
if people could even just clone, say whether they experience the same issue or not and state their IntelliJ version and edition (ultimate or community), that would be fantastic
weird
let me give it a shot on ultimate
i do personally use a multi module project so unsure why this is happening to you
yeah
I’ve also cloned and compiled other multi module projects
and never had an issue
hmm getting a weird error while syncing in regards to "invalidated caches"
try invalidating your caches xd
bump
That's a weird one. I'm seeing the same thing in IntelliJ Ultimate 2024.3
Do you see anything wrong with the gradle setup btw? No worries if you can’t check / don’t want to
I don’t see anything wrong myself.
Nothing obvious no, it looks fairly standard
The only weird thing I'm seeing is a warning about "Duplicate roots detected" when I open the IDE.
Path [.../SkyFactionsReborn/common/src/main/java] of module [SkyFactionsReborn.main] was removed from modules [SkyFactionsReborn.common.main
YES I have that, so has a helpchat person I asked too
no clue why it’s happening xd
It's a sourceSets problem, or I thought it was anyway. Maybe you get the same issue with modules. Paper includes discord and common, discord also includes common. That should be totally fine dependency resolution but 🤷 https://youtrack.jetbrains.com/issue/IDEA-210908/Do-not-auto-remove-duplicate-content-roots-detected
Dumb idea but have you tried renaming it from 'common' to something else?
hmmmmm
I’ll try later ^^
thanks!
will get back to you
Good luck!
No luck with renaming unfortunately
just tried refactor branch on 2024.3
no errors related to unresolved classes from common module
killing myself
you’re the second person who hasn’t had an issue
i'll give it a shot.
cheers ^^
this is your issue?
yep
anything in the common module can’t be resolved
well I just pressed the button and it worked
wtf is the button
reloading gradle breaks it again
Going to need some clarification on what the button is
"add dependency on module"
oh LMAO
mmmmh
so you have the issue too
I would just do that but hotswap doesn’t work at all so
don't
-# let's do it together
check project structure in intellij and see if common exists in modules tab
I’ll check but iirc it does exist