How to rebuild project structure libraries?
Answered
I have a complex project with lots of libraries and accidentally removed one library. How can i revert this / rebuild the project structure?
Gradle builds work fine but Intellij build fails.
Thanks!
Please sign in to leave a comment.
Refresh all Gradle projects: https://stackoverflow.com/a/34364528/104891.
I may have to add: It was a Gradle library I removed. The empty entry is still missing in Project Structure->Libraries but classes and source are missing.
Gradle refresh does not work.
Delete .idea directory and reimport from build.gradle.
Nevermind. Gradle refresh did work, but i had to select the specific Gradle (sub)project for refreshing external libs.
Seems like Intellij's "Refresh all Gradle Projects" does not work if one project contains multiple sub-projects with own dependencies.
Update, fastest solution i fond:
1. In "Gradle Projects" right-click->Detach external project.
2. File->New->Module from existing sources. And reimport the project.
This works better than "right-click->Refresh external project" for 30+ sub-projects.
Would be good if Gradle support could be improved here. Thanks anyway.
'Refresh Gradle project' should create/restore project structure for all modules of the gradle <multi->project.
'Refresh all Gradle projects' should create/restore project structure for all gradle modules in the IntelliJ project.
(Note, there can be more than one gradle multiprojects linked to the single IntelliJ project)
Could you describe the steps to reproduce (ideally with the project sample attached) the issue you encountered?
Thanks in advance!
I'm afraid I cannot disclose the company/product/code I'm working for.
I had general problems with Gradle Sync (Gradle assemble tasks were working, IntelliJ builds did not due to not updated libraries) but right now it's working fine.
auto-import did also not work, but is enabled now.
I will come back here if I encounter problems again.
... And "fixed" again after "gradle clean assemble" in the main project.
But this takes long and is annoying. I can give more specific information if you tell me what you need.