Need HELP ASAP! Building APK file error CommandInvokationFailure: Unable to list target platforms.
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 JD$$anonymous$$ installed, and all Android SD$$anonymous$$ 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 · Apr 22, 2017 at 06:24 AM
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