Never ending "Gradle has broken class path" errors

Viewed 536

I am a new developer using IntelliJ IDEA, making android apps in Java.

Problem:

I did- something 4 days ago in my libraries and/or dependencies when I was trying to add OpenCSV to a project. I am not exactly sure what the root cause was but now on the project I was working on and every project new or old that I have opened since then has errors like or identical to the ones shown in the pictures.

This is what my libraries look like (sometimes it's 21, 23, 25, or 31 errors. Just depends which project I open.) File>Project Structure...>Libraries

This is what my problems window looks like (reflects the issues in the libraries)

File>Project Structure...>Problems

I also now receive IDE Fatal Error Message that reads:

Attempted to add more sync issues when the SyncIssueRegistry was sealed!

java.lang.IllegalStateException
    at com.android.tools.idea.gradle.project.sync.issues.SyncIssueRegistry.register(SyncIssues.kt:46)
    at com.android.tools.idea.gradle.project.sync.issues.SyncIssues.registerSyncIssues(SyncIssues.kt:71)
    at com.android.tools.idea.gradle.project.sync.setup.module.AndroidModuleSetup.beforeSetup(AndroidModuleSetup.java:43)
    at com.android.tools.idea.gradle.project.sync.setup.module.AndroidModuleSetup.beforeSetup(AndroidModuleSetup.java:28)
    at com.android.tools.idea.gradle.project.sync.setup.module.common.BaseSetup.setUpModule(BaseSetup.java:33)
    at com.android.tools.idea.gradle.project.sync.idea.data.service.AndroidModuleModelDataService.setUpModule(AndroidModuleModelDataService.java:98)
    at com.android.tools.idea.gradle.project.sync.idea.data.service.AndroidModuleModelDataService.importData(AndroidModuleModelDataService.java:84)
    at com.android.tools.idea.gradle.project.sync.idea.data.service.ModuleModelDataService.lambda$importData$0(ModuleModelDataService.java:79)
    at com.intellij.openapi.command.WriteCommandAction.lambda$runWriteCommandAction$5(WriteCommandAction.java:351)
    at com.intellij.openapi.command.WriteCommandAction$BuilderImpl$1.run(WriteCommandAction.java:105)
    at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
    at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$1(WriteCommandAction.java:246)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:980)
    at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:245)
    at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:303)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:187)
    at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:305)
    at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:244)
    at com.intellij.openapi.command.WriteCommandAction.lambda$execute$0(WriteCommandAction.java:229)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$8(ApplicationImpl.java:475)
    at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:126)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:132)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
    at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:188)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:971)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:841)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:452)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:744)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:451)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:499)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Here is what happens when I just hit run on a totally fresh "Empty Project". What I have tried:

  1. Going to View > Tool Windows > Reload All Gradle Projects. Does nothing.
  2. Going to View > Tool Windows > Tasks > cleanup > lintFix Does nothing and gives me a "Aborting build since sources were modified to apply quickfixes after compilation" error
  3. Hitting "Fix" on all the problems in the problems window- which doesn't actually fix anything because I'm 90% sure I'm supposed to have the "\res" destination for the class with "broken class path"
  4. Deleting the "\res" destinations from libraries, again same issue fix as 3 basically, makes the "Problems" in Project Structure... go away, but gives me errors when I actually run the code. Plus, for both 3 and 4, when I close and reopen the projects- all those errors show back up again.
  5. Invalidate Caches and/or Restart. does nothing.
  6. Going to VCS and trying to load an earlier version. Unfortunately VCS doesn't seem to apply to gradle or libraries so no luck there.
  7. Uninstalling IntelliJ, deleting every file I can possibly find with "gradle" in it, even in AppData, deleted all my android SDK files and caches and IntelliJ caches I could find, reinstalled everything fresh and clean. Still, even a brand new baby project with no actual user code created the errors you are seeing in my screenshots.

Current status 1.0:

I don't know if this could possibly be because of Maven somehow, because I don't know if I ever finished setting up Maven for the first project where this error occurred- if it is I don't know how Maven is interacting with gradle if it is at all, or maybe the cause is something else deeper, maybe it's something simple, but I am really on my knees with this one here everyone. I've been chopping away at this for days on end with no progress yet.

If your suggestion is out of the box, involves moving to maybe Eclipse instead of IntelliJ and that's the best I can hope for. That's fine. Simply pressing "F" to pay respects, confirmation that I should give up on IntelliJ, anything. Any response to this post would really help and mean a lot to me.

Please and thank you,

Jeffrey

Current status 2.0:

I was able to get all my projects to work again, the build is going fine with 0 errors, I'm guessing it was the clean reinstall. All the red and "Problems are still in the "Project Structure..." but I am going to ignore it and leave everything alone so long as it works.

0 Answers
Related