Tuesday, May 15, 2018

CommandInvokationFailure: While Compiling for Android

While compiling for Android I got the following error:

CommandInvokationFailure: Failed to build apk. See the Console for details.
C:\Program Files\Java\jdk-10.0.1\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar"


Solution:

Use Java JDK 8. 

It seems that Unity 5.3.8 doesn't like JDK 9 or higher.
Downloaded 
jdk-8u171-windows-x64 from Oracle and install it.

Then in Unity under Edit > Preferences > External Tools point Unity to JDK 8.


No comments:

Post a Comment