Search Issue Tracker

Fixed in 2020.1

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 (16)

  1. 07be5fa9dca5884740e9af2be93b7942?d=mm

    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.

  2. 07be5fa9dca5884740e9af2be93b7942?d=mm

    Rock_Rafy

    May 05, 2020 11:35

    Hi ELDOMINANTEGRANDE which version you were previously.

    As per the above issue which error you were faced.

  3. 195a0450849326bb915ad447ed8cca65?d=mm

    eldominantegrande

    Mar 15, 2020 15:15

    Fixed with UnityEditor 2020.1.0b1.

  4. Cb48bb6c798bac79e01ff8e8bc9906a3?d=mm

    Folorox

    Mar 09, 2020 09:01

    Fixed by latest Unity Hub version 2.3.0. Thanks Unity!

  5. Fc51a2cee4f5b8133a66f5fc27acc229?d=mm

    russisunni

    Mar 07, 2020 14:07

    Thanks FILIW

  6. 195a0450849326bb915ad447ed8cca65?d=mm

    eldominantegrande

    Mar 01, 2020 13:35

    I'm still facing the issue with 2020.1.0a25.
    I could successfully use the workarounds for the OpenJDK and AndroidNDK but not for the Android SDK.

    I tried to copy the tools folder from my Android SDK folder to the SDK folder of the Unity editor but it still says that the Android SDK could not be found.
    Is there more to do than to copy the tools folder?

    I also tried to set the path to my Android SDK folder downloaded using the sdkmanager but that changed nothing.

  7. 30fec85ab04297908bc5ded283b0382c?d=mm

    philroh

    Jan 23, 2020 15:27

    You can download JDK here:
    https://jdk.java.net/java-se-ri/8
    That's working.

  8. 30fec85ab04297908bc5ded283b0382c?d=mm

    philroh

    Jan 22, 2020 18:29

    OpenJDK doesn't work for me.
    Error message: You are missing the recommended JDK. Install the recommended version using Unity Hub.
    Can I download it somewhere?
    Thanks in advance for your help.

  9. 8b69a927aa9646cfa256cc5942b257b5?d=mm

    alexds9

    Jan 21, 2020 07:19

    This problem still exist in Unity 2019.3.0f5, Unity Hub 2.2.2.
    Any chance it will be solved?

  10. Ebd0dfe65098a4bd917fda78bda527e1?d=mm

    senkal_

    Dec 28, 2019 21:42

    Thank you for creating this detailed bug report, wanted to create one myself but found this one instead.
    Big plus for info about possible solutions, especially the NDK workaround.
    This is a little annoying, have to admit :)
    Hopefully will be fixed relatively soon.

    I tried multiple version since 2019.2.x and can confirm this behavior 100%, always can reproduce.
    Ubuntu 18.04.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.