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/Wassim/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[ Error:Invalid command android ] stdout[
] exit code: 64
I tried every solution on the Web, Won't work I got latest JDK installed, and all Android SDK files with the build-tools "25.0.2" tried also copying the "zipalign.exe" solution won't work, Getting the "23.0.3" build-tools also didn't work!
Answer by liortal
5 days ago
There's a Unity bug, related to one of the latest versions of the Android SDK. Some command got deprecated (now returns exit code: 64). Unity probably considers any non 0 exit code to be a failure, hence failing your build.
You can read more about it (as well as get a workaround) in this link: https://issuetracker.unity3d.com/issues/android-build-fails-when-the-latest-android-sdk-tools-25-dot-3-1-version-is-used
Thank you so much, that really helped out!
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
165 People are following this question.
Unable to build Android game, build error
MOBILES WITH MOVIETEXTURE CAN'T BUILD
Android Unable to merge manifest Error
aapt.exe crash CommandInvokationFailure: Failed to re-package resources
Failed to repackage resources when building Android game