Unity - Android SDK error
Hello, please I need help. When i want build my project for Android, will appear errors and building is canceled. How Can I solve it? Thank you very much.
Error:
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 (x86)\Java\jdk1.8.0_131\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="D:/Android\tools" -Dfile.encoding=UTF8 -jar "D:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[ Error:Invalid command android ] stdout[
] exit code: 64
Answer by zakirshikhli · Apr 25, 2017 at 05:25 PM
Tested on Unity 2017.1.0b1 Beta
Delete tools folder from SDK path
Extract tools folder from downloaded *.zip to sdk path
On Unity, select Gradle build type, tick Export, hit Export button
Import to Android Studio, update back SDK Tools to 26.0.1
Build
If there will be errors on Android Studio, clean , rebuild, relaunch ide, delete build folder can help.
Answer by hMark · Jul 28, 2017 at 07:45 AM
I i wrote down an article about clean Unity/AndroidSDK installation which also solves this issue: http://devlog.markhlavac.com/2017/06/30/installing-android-sdk-for-unity3d-using-sdk-tools-and-cli/
Answer by Dymalle42 · Aug 14, 2018 at 01:48 PM
Hello,
Does anyone know if this problem is planned to be fixed anytime soon? I have tried this fix (going through SDK Tools r25.2.5) without success... It's been two~three days I am trying to build my game on Android without success because of this bug, though it successfully builds on Windows and IOs... When I apply @zakirshikhli solution I get many errors when I try to build on Android Studio, very unclear errors that I have no clue how to solve...
Eureka! I found a bypass that works: I am using SD$$anonymous$$ Tools R25.2.5 and jdk jdk1.8.0_172. I could successfully build within unity and tested my app on my phone. $$anonymous$$eep us informed of any new version of SD$$anonymous$$ and JD$$anonymous$$ that would work. In the meantime I'll keep using these old versions.
Answer by Shenanigans2 · Aug 31, 2018 at 04:01 PM
here's a video tutorial on how to change the sdk tool folder: https://youtu.be/qy_s4lurHYQ
-you need jdk 8: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html:
-SDK Tools r25.2.5: http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
Your answer
![](https://koobas.hobune.stream/wayback/20220612120458im_/https://answers.unity.com/themes/thub/images/avi.jpg)