Android SDK cannot be found during Unity compilation | Unable to list target platforms, unityengine. ui cannot be found

Source: Internet
Author: User

AndroidSDK cannot be found during Unity compilation | Unable to list target platforms (reprinted), unityengine. ui cannot be found
Original article: http://www.jianshu.com/p/fe4c334ee9fesymptom

When compiling Android applications with Unity, you may encounter the problem of Unable to list target platforms.


Error Message

Detailed error description:

Error:Invalid command android
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

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_91\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="D:/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "D:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
Error:Invalid command android
]
stdout[

]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

Brief description of the cause

Unity will call the Android command in android SDK tools during compilation. In the new version of Android SDK tools, the android command has been discarded, and Unity cannot be compiled normally. My Android SDK tools version is 25.3.1.

Process of finding the cause

After repeated confirmation, the Android sdk I configured is okay.


SDK settings


Later, I noticed that "invalid android command" was mentioned in the error description, so I tried to directly call the android command to see if there was any problem.

Error:Invalid command android

The android command is android. bat in the tools directory of AndroidSDK. You can call this command directly and find that the command has been discarded.

The "android" command is no longer available.
For manual SDK and AVD management, please use Android Studio.
For command-line tools, use
tools\bin\sdkmanager.bat and tools\bin\avdmanager.bat

Solution

If you know the cause, the problem will be solved.

Compared with the tools of the two versions, the difference is really great, and a lot is missing. For example, the draw9patch of the. 9 graph does not know where to go.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.