New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 #384
Comments
I have the same issue ! |
Hi, I'm getting the same issue, installing OpenJDK via Unity Hub did not work for me. I tried uninstalling and reinstalling Unity with the Android SDK and OpenJDK included, still getting this error. Any help or ideas would be greatly appreciated, thanks! |
Thank you @patm1987 for response. However, I have OpenJDK installed via Unity HUB with the exact same configuration as you do. After submitting this issue, I tried it again and... voilà... it worked. I changed nothing. So now I have exact 4 successfull cases (in several months). |
I run into the same issue 👎 |
Also experiencing this on latest EDM4U 1.2.157, with Unity 2019.4.5f1 set up to use 100% external tools bundled in install from Hub. |
Yes, this appears to be the case. You can work around this issue by setting the systemwide java install to OpenJDK java 1.8 (e.g. |
@roger-o3h can you give more details how you work around this issue? just installing this jdk cask does not cut it for me. |
|
You may have multiple JVMs installed? Can you paste the output of |
Yeah I had multiple JVMs installed apparently, after uninstalling all but the |
Yes, that jives with what I think is going on here... And means I'm not
alone in getting this error! Hopefully the workaround will tide us over
until the issue is resolved. Thanks!
|
Possible duplicate of #323 |
I faced the same issue and have only 1 JVM installed |
This issue started reproducing today for no particular reason :( Unity 2018.4.10f1 |
Yeah we also still have one machine with this issue... |
I had the same problem when upgrading Kotlin from 1.3.x to 1.4. Since Kotlin 1.4 demands a newer version of gradle I hade to upgrade my gradle version on my machine. This made my groovy tests failing, resulting in the exception raised in this thread. After trying out some different stuff I managed to get it working by doing the following. 1. Remove apply plugin: ‘groovy’ from my build.gradle file Hope it works for you guys as well! Good luck! |
I resolve this problem with this article. (language:japanese) ・After play External Dependency Manager>Android>Force Resolve, unity editor version is 2017.4.40f1 |
Hi folks, I actually tried to upgrade gradle from
Due to this, I'm quite concerned to upgrade gradle for EDM4U to 6+. And make EDM4U compatible to 6+ turns out to be a pretty tedious work. For those who installed later version Gradle, as long as If this remains to be an issue for you, I would recommend to utilize It looks like this is impacting many people, and I cannot reproduce this issue on my machine. If possible, please offer a minimum viable project and your configurations (Unity version, JDK version, External tools settings, OS, etc). Thanks |
Thanks, changing version from |
Interesting fact: my problem was not in a gradle. I used maven =) |
Same problem here. Worked on one machine, but not on another. Confused about this. :-/ |
Ok, I found the issue of my installation: On the new machine, I installed JDK 15, which is the default you get directed to if you run https://www.oracle.com/de/java/technologies/javase-downloads.html After downgrading the JDK to 1.8 (as on my other machine), everything worked again. It seems as if there's a problem with JDK 15. |
What still confuses me: Unity is setup to use its own Open JDK, but this seems to be ignored by the resolver. |
Getting this problem for Spring boot project java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache |
managed to fix it, implemented all of the following, no idea what did it:
|
I solved my issue by unchecking the default OpenJDK which comes with unity and installing JDK version 1.8 and setting up the Environment variable path in Unity. |
Just install JDK 8 and it most likely fix the issue! |
Can cofirm: new macbook, new Unity Install (2020.3.20f1) failed to compile for android. I had only JDK17, I removed it and installed JDK8, then I unchecked JDK Installed with Unity and set to point to JDK8 (/Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk) Probably I've could have kept the JDK17 |
using jdk 1.8 solved this for me (using intellij on windows 10) |
I solved my issue like this by disabling jetifier in the setting of android resolver, then force resolving, and it resolved without error. I revert from 10.14 to 10.12, cause i couldn't get it to work, and i did nothing to my google play system and its been working flawlessly until recently for some reason. which happened more or less after the 10.14 update. i found just a simple restart of the computer seems to work when i had this issue before. but that didn't work now. hope this helps someone, been dealing with google issues for days now |
Hi, as a colleague says above, in my case, working with Unity on OSX, the problem was that gradle was using the version of java installed on the system, not the one embedded in Unity. I fixed it by editing the .zshrc file in the user folder and adding: |
I had Unity freeze when trying to build for Android (and errors about missing JRE after starting Unity). The fix is a bit non-obvious that I first installed a recent JRE (17), getting the OPs error and then finding this ticket to understand it has to be version 8. How about fixing this google and using the Unity-included version 8 JRE so people don't have to fiddle so much? |
Stumbled upon this issue (again). I remember reading some answer on the Unity Answers site that fixed this before, and it's fixed it again now. To fix this without mucking around with any installations or editing any files:
The act of toggling each checkbox resets something within Unity's settings somewhere. Afterwards, Gradle should function properly. |
This might work in some cases but I also did that and it did nothing |
This worked for me (this time at least)! Thanks, you've saved me from restarting my PC constantly 😓 |
Worked here, Unity 2019.4 |
I can't believe it! This simple thing is actually works for me! No need to install another java. No need to upgrade gradle. No need to reinstall Unity! No need to buy a new PC! Just disabled all of them. And enabled it again. It's works! It's really that simple! |
The unchecking and checking of boxes work. Another small, funny issue with external dep manager that forces me to re-open Unity: subsequent resolves and force-resolves fail silently after gradle encounters an error. So on first opening Unity, uncheck and re-check your boxes THEN force resolve. |
This problem is like wack a mole I fix it. Then something happens and it breaks again and none of the fixes work again. I have wasted an ungodly amount of time on this problem |
3 years since issue was created, still having the same problem |
googlesamples/unity-jar-resolver#384 The cause was the lack of required dependencies. The Android Manager's Force Resolver would throw a ClassNotFoundException when starting a Gradle daemon. Fixed it by removing another installation of Java SDK used in another project, because apparently Unity was trying to use that SDK, instead of OpenJDK it has downloaded.
imannms000 |
programming in a nutshell 😮💨 🌴 |
Still having this issue, unity build system is truly horrendous |
This worked for me! Thanks a million, bro. |
I did the following to make it work (I'm on mac):
|
Do you happen to have any news on this? I'm still having this problem on both Unity 2020 and 2022, I can confirm that EDM4U is ignoring Unity's JDK and using the one set on JAVA_HOME. Since I'm having this problem on batch mode, I had to implement a build preprocessor that sets the JAVA_HOME to Unity's JDK to fix it. It seems simple to solve it on the EDM4U's side. |
For those who using Jenkisn, if your jenkins is not running on Java8, In the Build History/Environment variables page you will find the JAVA_HOME variable is not the value you want. And for some reason, this will lead to the problem.
|
I still have this error. Unity > Edit > Preferences > External Tools checkboxes, paths change does not help at all. Also tried with JDK 8 installed, and set the path there in Preferences. Same result |
Please fill in the following fields:
Unity editor version: 2019.4.0f1 and also multiple of 2019.3.x versions
External Dependency Manager version: 1.2.155
Source you installed EDM: Unity Package Manager
Features in External Dependency Manager in use: Android Resolver
Plugins SDK in use: Firebase, Facebook, IronSource
Platform you are using the Unity editor on: Mac OS Catalina (10.15.5)
Platform you are targeting: Android
Scripting Runtime: IL2CPP
Please describe the issue here:
I am unable to run Android Resolver because of exception:
I found out that it is related to Gradle issue: gradle/gradle#10248
So I tried to:
And it finishes without any problem.
My suggestion is to upgrade the Gradle used by resolver.
Please answer the following, if applicable:
What's the issue repro rate?
99%
In the past, I was able to run Android resolver successfully 3 times exactly. I really don't know why it worked, because it was always with the same configuration after countless of failures.
The text was updated successfully, but these errors were encountered: