Commandinvocationfailure: failed to build APK problem record

just built a complete game framework, debugging process, packaging real machine test, but found unable to package, the error report is as follows:

this problem refer to https://blog.csdn.net/THmen/article/details/79424469.

according to THmen, “Unity will call the Android command in the Android SDK tools when it is compiled, but in the new version of the Android SDK tools (mine is 26.1.1), the Android command has been deactivated, so Unity cannot compile normally”. ok, follow the steps to solve, repackage, found another problem, as follows:

error:

C:/Program Files/Java/JDK – 10.0.1 \ bin \ Java exe – Xmx2048M – Dcom. Android. Sdkmanager. Toolsdir = “C:/Users/user/AppData/Local/android Sdk \ tools” – Dfile. = encoding UTF8 – jar “C: \ Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar” –

checks to confirm that all configurations are correct.

so what’s the problem?My Unity version is 5.6.6, which is basically the latest version of 5.x.

since I downloaded the SDK and JDK with Android Studio 3.1.2, is it still a version issue?My JDK is 10.0.1, so I go back to JDK 8 .

try again, the problem has been solved, packaging success, this record!

Read More: