Setting android tools location in unity

In Unity 5.1, when I build my project for Android I get this error. I believe this is cause because I was messing around with some of the variables in cmd. It used to build perfectly fine before I made any changes. The error says its looking in /android-sdk/ though I know this is incorrect, and its under just /sdk/. I tried reinstalling android SDK but that didn’t work, and I also tried looking for com.android.sdkmanager.toolsdir to edit the location of the tools directory but I had no luck. Any help? :slight_smile:

CommandInvokationFailure: Unable to resolve build tools directory. See the Console for more details. 
C:\Program Files (x86)\Java\jdk1.7.0_71\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Users/OWNER/AppData/Local/Android/android-sdk	ools" -Dfile.encoding=UTF8 -jar "C:/Program Files/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

stderr[
Error:C:\Users\OWNER\AppData\Local\Android\android-sdk	ools is not a directory. calculated from system property com.android.sdkmanager.toolsdir
]
stdout[

I have same problem.

I fixed by android sdk tool version downgrade.

The steps.

Delete android sdk “tools” folder : [Your Android SDK root]/tools → tools
Download SDK Tools: http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
Extract that to Android SDK root
Build your project

I had exacly the same problem with the same console message!

Install Android NDK. I recomend you to download NDK, SDK and tools via Android Studio’s SDK Manager. Some components in your project require NDK to make the Android Build (.apk).
At least this worked on me.

I am not sure why the others suggested you re-download Android tools, since you mentioned that Unity was trying to point to the wrong directory. To fix the directory problem, simply:

Go to Unity > Preferences > External Tools and modify the path to your Android SDK there.

I’m facing this issue even though I’ve installed all the tools, including the ndk, and have gone through every step of the process to fix this problem. I’ve downloaded a downgraded version of the sdk, which still gave me the same error message. I’ve found the path for unity for the sdk, ndk, and jdk, and none seem to get rid of this error message. I’ve ensured that all my settings on my android phone are set for developer and allow me to debug. I can’t figure out what’s wrong.