You may need to install Java8. The Android SDK refers to the system’s JDK …
Perhaps the currently installed JDK is 11 or 12, so it is quick to remove it.
However, to install Oracle Java8, you need to register an account, and using Open JDK may be easier.
New Unity comes bundled with Java so it shouldn’t need any external java “stuff”.
Removing them should fix any java issues, as long as you choose to install and use the bundled java.
However there is another bug on unity that leaves some path bars inverted and apparently this bugs the java usage.
Hey everybody, i have the same error on my windows10, and installed android studio latest version, I set android studio SDK path to unity android sdk path, and it is solved.
Hi, I had the same problem and solved it as follows: 1. I uninstalled my previous version of Java. 2. Installed Java 8
(Java SE Development Kit 8u251). 3. Copied the path to my environment settings in Settings/Environment settings. Moved it up in the hierarchy 4. Also added JAVA_HOME path to the environment settings. 5, IMPORTANT Went to Unity: Edit/Preferences/External Tools.
6. Here I unticked the following boxes under ANDROID: (a) JDK installed with Unity (Recommended) and browsed to where Java is stored (C:\Program Files\Java\jdk1.8.0_251) (b) Did the same with SDK. 7. MAGIC!
I had same issue on Mac after previously making build without an issue. I uninstalled current Unity version ( 2019.3.4 ) through Unity Hub and installed new version ( 2019.3.14 ). If you have same issue, try to reinstall Unity version.
We are using Unity 2019.3.12f1 and I’m getting this same issue on a Mac. We can’t update our project yet at the moment to a newer version of Unity. Does Unity have an official workaround for this? Is it actually fixed in a newer version of Unity?
Thanks.
Hey, I had the same issue on Ubuntu18.04. Yesterday I was able to build the Android apk but today I was not able anymore.
I fixed it exporting the JAVA_HOME environment variable (pointing to Unity Java SDK installation) and appending the Java executable to the PATH environment variable:
I had this problem too, seemingly out of nowhere. My Android game compiled one night and the next it didn’t. I did enable the keystore for it, maybe that caused it?
But I uninstalled Java (I had v13 I believe) and re-installed JDK v8. I also added the JAVA_HOME environment variable since it wasn’t there (following Yerbol05’s link above) after installation. I then went into Unity → Edit → Preferences → External Tools, unchecked the Unity Open JDK, and specified the Java installation directory (C:\Program Files\Java\jdk1.8.0_251).
My game then compiled. I was thinking it was due to some Android SDK issue, cause of the error message, but it seems to have been Java (for whatever reason).
Hi. i had same problem and i solved.
i remove my JAVA_HOME variable but it doesn’t change any thing.
i have unity 2019.4(lts) and java 8 and updated SDK and i added java_home in my variables. i download a another version of JDK and SDK and put them in unity! and i try to build, and my error fixed. now i back my jdk and sdk and try to build again and its work!