Search Issue Tracker

Fixed in 2020.1.X

Votes

30

Found in

2019.3.0a12

Issue ID

1177631

Regression

No

[Linux] Unity Hub sets up Android SDK, NDK and JDK incorrectly on Linux

Hub

-

Android deployment tools are set up incorrectly on Linux, we've found the following issues, resulting in the tools not being recognized by Unity:
1) The executables in OpenJDK (Editor/Data/PlaybackEngines/AndroidPlayer/OpenJDK) don't have the right permissions for execution (possibly due to wrong compression/uncompression of JDK archive) - "chmod +x OpenJDK" fixes the JDK location.
2) Android SDK (Editor/Data/PlaybackEngines/AndroidPlayer/SDK) is missing the tools directory in it. Copying the tools dir from somewhere else fixes SDK.
3) Android NDK is unpacked to the wrong directory (Editor/Data/PlaybackEngines/AndroidPlayer/NDK/android-ndk-r19 instead of Editor/Data/PlaybackEngines/AndroidPlayer/NDK, compared to other platforms) - moving the contents to the correct directory fixes NDK.

How to reproduce:
1. Create or open any project on a version that was installed via Unity Hub (along with Android SDK & NDK tools)
2. Go to Preferences -> External Tools and make sure that Android SDK/NDK Installed with Unity checkmarks are ticked
3. Build for Android

Expected results: Project .apk is successfully built
Actual results: Errors regarding not being able to locate Android SDK

Reproducible with: 2019.1.14f1, 2019.2.6f1, 2019.3.0b4, 2020.1.0a3 (versions downloaded through Unity Hub)
Versions 2018.4 and below do not have the option of downloading SDK & NDK tools through the Hub

Behavior in 2019.1.14f1 - when trying to build, a dialog box appears "Android SDK is outdated. SDK Tools version 0.0.0 < 26.1.1."
Behavior in 2019.2.6f1 - dialog box contains "Unable to locate Android SDK"
Behavior in 2019.3.0b4, 2020.1.0a3 - dialog box contains "Android SDK not found or invalid. Please, fix it in Preferences -> External Tools"

Notes:
- In 2019.3.0b4 and 2020.1.0a3, in Preferences window under Android SDK Tools and NDK Installed with Unity (recommended) there are warnings that say:
"You are missing the recommended Android SDK Tools / NDK. Install the recommended version with Unity Hub."
- Workaround is to use external SDK & NDK, for instance downloaded through Android Studio
- In Data/PlaybackEngines/AndroidPlayer SDK & NDK content exists, but Editor does not locate it correctly

Comments (23)

  1. lucas12347700

    Jan 17, 2023 02:23

    Lmon

  2. lucas12347700

    Jan 17, 2023 02:21

    Unity hub

  3. agajulapally

    Feb 01, 2022 23:05

    This does not work on the recommended 2020 LTS version 2020.3.27f1

  4. Rattaspi

    Nov 26, 2021 16:10

    I have this issue in the 2021.1.14.

  5. CitizenZero000

    Oct 21, 2021 03:37

    still a problem

  6. mhmmdemen

    Oct 12, 2021 19:58

    This problem still exists in 2021.1.23f1 - Unity Hub 2.4.5. I think maybe it because of permissions. I dont want install tools with other ways because all tools already including in unity.

  7. Pachanka

    Mar 16, 2021 22:05

    Still exists in 2020.2.7f1 :/

  8. Rock_Rafy

    May 05, 2020 11:41

    Please note as mentioned in the above issue I am working on Unity 2019.3.12f1 (Windows), The dialog box contains "Android SDK not found or invalid. Please, fix it in Preferences -> External Tools" .

    Can anyone please tell me Updating to Unity 2020.1.0b7(beta) (Windows) will fix the issue or not. Please inform. I don't want to install an android studio separately.

    Sorry for the poor English.

    Thank you.

  9. Rock_Rafy

    May 05, 2020 11:35

    Hi ELDOMINANTEGRANDE which version you were previously.

    As per the above issue which error you were faced.

  10. eldominantegrande

    Mar 15, 2020 15:15

    Fixed with UnityEditor 2020.1.0b1.

Add comment

Log in to post comment