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 ools” -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

5 Answers

5

Tested on Unity 2017.1.0b1 Beta

  1. Delete tools folder from SDK path
  2. Download SDK Tools r25.2.5
  3. Extract tools folder from downloaded *.zip to sdk path
  4. On Unity, select Gradle build type, tick Export, hit Export button
  5. Import to Android Studio, update back SDK Tools to 26.0.1
  6. Add to Manifest “internet permission”,
  7. Build

If there will be errors on Android Studio, clean , rebuild, relaunch ide, delete build folder can help.

1 - This is strange. You shouldn't see this in your project. This strangely looks like the folder layout of the cache. Can you give me the path of your project? 4 - In 2017.2 or 2017.3, the package manager is not used at all. Nothing should be populated. The intention was there to enable the feature but in the end we did not had the time to introduce a proper UI.

–

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/

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 SDK Tools R25.2.5 and jdk jdk1.8.0_172. I could successfully build within unity and tested my app on my phone. Keep us informed of any new version of SDK and JDK that would work. In the meantime I'll keep using these old versions.

–

Read where it is saved, it is in his answer.

–

it should either be in your assets or download it from server. once you build your project, it cannot access any files in your pc.

–

here’s a video tutorial on how to change the sdk tool folder: - YouTube

-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

I will provide a working package of Unity, Android SDK, NDK, JDK programs.
Ask in the mail turtletools3@gmail.com