This error keeps happening every once in a while in my Kotlin projects. I tried several Kotlin versions (1.3.41, 1.3.60, 1.3.72) but this seems to come up on any version and in various projects. Once it starts happening, I can't build any project.
Full error message:
Unable to load class 'kotlin.coroutines.Continuation'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt.
Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
I have tried all the suggestions and none of it helped. When I click
"Re-download dependencies and sync project (requires network)", it says
Clicking "Stop Gradle build processes (requires restart)" restarts Intellij but doesn't help.
Closing Intellij and killing Java processes didn't help either.
While none of the linked suggestions in the error popup worked, running 'clean' gradle task manually did do the trick!
./gradlew clean
The error still comes up every once in a while but can be reliably fixed by running gradle clean.
Related
Lately (even after cache cleanup/reinstalls) I have issues with idea, where builds are failing, run configuration is failing. The problem is, that it is idea thing, maven builds just fine, run from cli runs just fine.
In idea I already checked "delegate build/run configurations to maven", and run configuration does not have any action to be done before build. Yet for some reason when I click run, it tries to download some libraries and then it fails. Second later java -jar from cli using previously outside of intellij build jar WORKS.
How to turn all these clever (and for me dysfunctional) stuff? I just want idea to run java -jar and that's it to minimize number of places, where it can fail. I know about possibility starting code externally from java and just connect with debugger, but I'd like to avoid it as it is not that convenient, and if I have ultimate edition, I'd like to be able to start debugging session from ide.
EDIT:
maven project is freshly updated, jdk is the same as one used maven. Yet for some reason project run produces:
java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration.propertySourcesPlaceholderConfigurer
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration] from ClassLoader
Caused by: java.lang.NoClassDefFoundError: javax/servlet/Filter
second later, java -jar using fat jar works.
I'm facing difficulties in setting up a gradle project. During setting up of the Gradle settings in the wizard,
I am not able to use the default recommended gradle wrapper because it downloads the Gradle and the network connectivity is very bad. So I go with the local gradle distribution which I have installed in my Ubuntu. On refreshing of the gradle project after creation, I always get stuck to this error. When I run the gradle build command through the terminal on the empty project, It works fine.
I have also tried the troubleshooting solutions given by the IDE. But, that made no improvements. Need assistance to solve this problem.
Comment if any additional info required.
As no-one else has chipped in, an approach that should work is to use the Gradle Idea Plugin instead of relying on the build in support Gradle in Idea. In my experience the plugin supports a wider range of Gradle project structures than Ideasupports directly. So you would
Create a Gradle project outside Idea and confirm it all works on from the command line.
Add the Idea plugin to the project
Run 'gradle cleanIdea idea' to generate the Idea project files.
Open up the newly generated project files from Idea and off you go.
I'm currently using sonarqube LTS(4.5.7) with Findsecbugs plugin installed.
The problem is when running mvn clean install with sonar profile the build fail and it says :Failed to clean project,failed to delete C:..\myproject..\findsecbugs.jar
so it's clear that the findsecbugs.jar cannot be removed in the cleaning phase
i've done some research and it seems that Java process is locking the resource.
Is there anyway to solve the problem knowing that if I kill the Java process it will stop mvn Build.
PS: I cannot move to the latest version of sonarqube since generating issues report in publish mode is no longer supported.
Problem solved by making maven ignore the jar in cleaning phase.
I have a libGDX project generated by the gdx-setup.jar tool, including core, android, desktop, and html modules. I hadn't touched any of the gradle files, and my build has worked fine for some weeks.
This morning when I opened IntelliJ IDEA (build 135.1230), it offered to update the Scala plugin, so I accepted and restarted, before trying to open the project. My libGDX project doesn't use Scala at all: I have the plugin for other work. When I tried to open the project, I got the infamous "Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly" message. Clicking "Try again" thinks for a bit before showing the same message. The Event Log window contains no output, and the Messages window says:
Error: (of class java.lang.String)
The Scala plugin isn't the only thing that might have changed: I've rebooted the (Ubuntu) machine since the project last worked, so it's possible that some package updates might have only just had an effect.
Following the advice of others, I've tried editing the root gradle.properties to change org.gradle.configureondemand to false, and that made no difference. I've tried performing "Build → Clean Project" and "Invalidate and Restart", with the same effect. I've also tried running git clean -X and reimporting the Gradle project into IDEA, but I just get a "Resolve error" dialog with the same message as above.
Running a build command like
./gradlew android:assemble
from a shell still works fine: only IntelliJ IDEA has a problem.
Even if you've never seen this particular problem, I'd appreciate any tips on where to start debugging it. The error message doesn't exactly give me a lot to go on.
The project I'm developing uses Datanucleus 2.0.3, so I'm using those libraries for enhancement (plugin is configured to use the module dependencies as well). IntelliJ version 12.0.1 on a Ubuntu 12.4 machine. I know the 2.0.3 is ancient history but upgrading it at least now is not an option for me.
From gradle all works fine. I imported by project to IntelliJ and when I ran the tests from junit I got the usual ClassNotPersistenceCapableException so I recalled I need a plugin for this.
I installed the newest plugin (tried both the beta and the last stable version) and configured the plugin to enhance my this one module. I chose JDO and applied, it discovered all the classes annotated for persistence, I rebuilt the whole project, ran the tests again and the same error occurs.
some things I've noticed / checked:
- the Enchaner is ticked in "Build / Datanucleus Enhancer"
- looked for multiple datanucleus jars, but there is only one
- haven't seen any message in IntelliJ in the Event Log saying is has done enhancing (the gradle enhancer logs such a message)
- haven't seen any error messages in IntelliJ saying enhancement failed, I also didn't find any log files outside IntelliJ (should there be any?)
- when I manually added the gradle built classes at the top of the classpath for the test the tests passed - but this is no good
- the module has the following datanucleus 2.0.3 jars on it's classpath: datanucleus-core, datanucleus-enhancer, datanucleus-connectionpool, datanucleus-rdbms and the asm-3.1.jar (the dependencies say it's 3.0-4.0 so this one should fit)
I have no idea why it sees the classes but doesn't enhance them, or maybe it does try and silently fail ... but then I don't know how to diagnose the problem
No other ideas come to my mind, please advise what to check or what to try.