0

Can somebody help mi solve these problems List of erros:

  1. UnityException: Build failure! Unable to locate Android SDK. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, UnityEditor.Android.CommandInvokationFailure ex) 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, BuildTargetGroup targetGroup, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:97) UnityEditor.HostView:OnGUI()
  2. 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_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/karik/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "D:\1.Programy\5.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()

  1. Error building Player: 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_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/karik/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "D:\1.Programy\5.Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[ Error:Invalid command android ] stdout[

] exit code: 64

SDK path: C:\Users\karik\AppData\Local\Android\sdk JDK path: C:\Program Files\Java\jdk1.8.0_131

I.B
  • 2,925
  • 1
  • 9
  • 22
Karol
  • 5
  • 1
  • 6

1 Answers1

2

Okay so the issue seems to be that the SDK updates deprecated a command line tool that Unity's build process uses. This was evident from the forum post Here

  1. Rename your tools folder in the SDK to some arbitrary name.
  2. Download the downgraded tools and extract them to the SDK root folder.

See if your issue is resolved!

If that does not work, try downgrading to the next lower version of SDK tools from the SDK manager.

Suraj S
  • 1,019
  • 7
  • 18
  • Thanks. it helped me. Can you tell me what it did ? – Karol Jul 06 '17 at 15:32
  • Unity Android build pipeline needs to be updated regularly to accommodate Android SDK changes, but that doesn't seem to be the case, updates will roll out, in time, for the time being we have to use a lower version of SDK tools so unity can work with it! – Suraj S Jul 06 '17 at 15:35