Home > Java > javaTutorial > Why Can't I Build for Android in Unity: Error 'Unable to List Target Platforms'?

Why Can't I Build for Android in Unity: Error 'Unable to List Target Platforms'?

Barbara Streisand
Release: 2024-11-13 14:13:02
Original
852 people have browsed it

Why Can't I Build for Android in Unity: Error

Error: Unable to List Target Platforms

When attempting to build an Android project in Unity, users may encounter the following 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.
Copy after login

This error typically occurs due to an incorrect Android SDK path or outdated SDK components. To resolve this issue, follow the steps outlined below:

Solution 1: Verify Android SDK Path

  • Ensure that the Android SDK path in Unity Editor's Preferences is correct.
  • If the SDK path contains spaces, move the SDK to a location without spaces and update the path accordingly.

Solution 2: Update Android SDK

  • Uninstall the current Android SDK and download and install the latest version from the Android Developers website.
  • Update the Android SDK path in Unity Editor's Preferences.

Solution 3: Download Specific SDK Version

  • For Windows: Download "tools_r25.2.3-windows.zip" and unzip it.
  • For MacOSX: Download "tools_r25.2.3-macosx.zip" and unzip it.
  • Add the path of the unzipped SDK to Unity's External Tools -> SDK box.

Additional Tips:

  • If the issue persists, uninstall Android SDK Tools 25 and 26, as well as SDK Platform-Tools and SDK Tools with higher version numbers.
  • Use older version numbers for these components if possible.
  • Update Unity Editor to the latest version, as the issue may be resolved in newer builds.

The above is the detailed content of Why Can't I Build for Android in Unity: Error 'Unable to List Target Platforms'?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template