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
Admincraft Meta
Admincraft Meta2mo ago
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
Skullians
SkulliansOP2mo ago
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
Game_Time
Game_Time2mo ago
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
Skullians
SkulliansOP2mo ago
yeah I’ve also cloned and compiled other multi module projects and never had an issue
Game_Time
Game_Time2mo ago
hmm getting a weird error while syncing in regards to "invalidated caches"
Skullians
SkulliansOP2mo ago
try invalidating your caches xd bump
Koth
Koth2mo ago
That's a weird one. I'm seeing the same thing in IntelliJ Ultimate 2024.3
Skullians
SkulliansOP2mo ago
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.
Koth
Koth2mo ago
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
Skullians
SkulliansOP2mo ago
YES I have that, so has a helpchat person I asked too no clue why it’s happening xd
Koth
Koth2mo ago
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?
Skullians
SkulliansOP2mo ago
hmmmmm I’ll try later ^^ thanks! will get back to you
Koth
Koth2mo ago
Good luck!
Skullians
SkulliansOP2mo ago
No luck with renaming unfortunately
imMohika
imMohika2mo ago
just tried refactor branch on 2024.3 no errors related to unresolved classes from common module
Skullians
SkulliansOP2mo ago
killing myself you’re the second person who hasn’t had an issue
Loudbook
Loudbook2mo ago
i'll give it a shot.
Skullians
SkulliansOP2mo ago
cheers ^^
Loudbook
Loudbook2mo ago
this is your issue?
No description
Skullians
SkulliansOP2mo ago
yep anything in the common module can’t be resolved
Loudbook
Loudbook2mo ago
well I just pressed the button and it worked
No description
Skullians
SkulliansOP2mo ago
wtf is the button
Loudbook
Loudbook2mo ago
reloading gradle breaks it again
Loudbook
Loudbook2mo ago
No description
Skullians
SkulliansOP2mo ago
Going to need some clarification on what the button is
Loudbook
Loudbook2mo ago
"add dependency on module"
Skullians
SkulliansOP2mo ago
oh LMAO mmmmh so you have the issue too I would just do that but hotswap doesn’t work at all so
imMohika
imMohika2mo ago
don't -# let's do it together check project structure in intellij and see if common exists in modules tab
Skullians
SkulliansOP2mo ago
I’ll check but iirc it does exist

Did you find this page helpful?