- Home /
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? :)
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\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -
stderr[
Error:C:\Users\OWNER\AppData\Local\Android\android-sdk\tools is not a directory. calculated from system property com.android.sdkmanager.toolsdir
]
stdout[
There's my problem. The SD$$anonymous$$ path was set to the wrong folder, not sure how that got changed. Thank you for the help! ;)
Answer by vartv27 · Oct 19, 2017 at 05:50 AM
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
Answer by AlienPentiumX · Oct 19, 2017 at 01:01 PM
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.
Answer by tsibiski · May 15, 2018 at 04:46 PM
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.
Answer by firez2469 · Jul 12, 2018 at 05:11 PM
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.
Your answer
Follow this Question
Related Questions
How to get Android 10 (API Level 29) 1 Answer
AndroidApiLevel30 ? 0 Answers
com.android.tools.r8 compilation error please help 0 Answers
Cannot install apk in android 8.0.0 (API level 26) 0 Answers
Do i need Android Studio or Xamarin? 2 Answers