- Home /
Please Help! CommandInvokationFailure and other build errors
At this point I am almost about to switch game engines i'm getting so frustrated. I am currently creating a game and i'm at the testing stage, so i downloaded the testing example provided by unity with the red cube etc. no matter what i do for {android} there seems to be a problem with the SDK. I have tried all solutions at this point, re-downloading older one, this and that. so i have boiled it down to 2 errors, 1 with the older SDK, and 1 with the newer SDK with android manager...
Here is the problem with the old SDK : Error building Player: CommandInvokationFailure: Unable to resolve build tools directory. See the Console for more details. C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/imabe/Desktop/SSDDKK/tools\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" - and NullReferenceException: Object reference not set to an instance of an object UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSdk.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (BuildOptions options, BuildTarget target) UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (BuildOptions options, BuildTarget target) UnityEditor.PostprocessBuildPlayer.PrepareForBuild (BuildOptions options, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:98) UnityEditor.HostView:OnGUI()
with the other new SDK its: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/imabe/AppData/Local/Android/sdk1\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[ Error:Invalid command android ] stdout[
] exit code: 64 UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.HostView:OnGUI()
PLEASE HELP, I WANT TO REALLY USE UNITY3D INSTEAD OF THE OTHERS. this problem occurs with my game and the unity test one. THANK YOU
Try to not use the desktop
-Dcom.android.sdkmanager.toolsdir="C:/Users/imabe/Desktop/SSDD$$anonymous$$$$anonymous$$/tools\tools"
Everything that you use on your desktop... place it in a proper folder just off the root of your drive.
C:/WOR$$anonymous$$/SD$$anonymous$$/ for example.
Then, read the error. You see things like this in it:
Please make sure the android sdk path is correct
Its trying to tell you in its arse backwards way whats wrong. Chuck the bits into google and see what it says.
$$anonymous$$ake sure your Android SD$$anonymous$$ is properly installed including the build tools and platform tools. Its also requires proper setup of Java.
You have to set the android sdk path and jdk path to environmental variables. $$anonymous$$ay you have not set the new sdk path to your environmental variables. If problem persists then update your sdk and try again.
Answer by GameCash · Apr 11, 2017 at 07:07 AM
Figured it out. Had to rename a couple files and also do the enviromental variables. Thanks guys. After I put the jdk bin folder to an enviromental varibale, i then seen that one of the sdk's i had was actually the "tools" folder that unity was complaining about. So i went to my original sdk and deleted the original tools folder and replaced it with my tools folder i had named "ssddkk". so after i replaced that tools folder with ssddkk i renamed ssddkk to just Tools. It worked. can test my game now. Unity confused me with the "platform tools" error when it was just the tools that was a problem, and also sdk's cannot be on the desktop like guy said above me. message me if anyone else had this problem and need pictures..thanks again
Your answer
Follow this Question
Related Questions
CommandInvokationFailure: Gradle build failed 0 Answers
Not pushing content to device 0 Answers
Build and Run on Android not working 0 Answers
Installation fail on build and run 2 Answers