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. C7e90d97c00cd36dc2e90a404c211359?d=mm

    tbsenior

    Dec 28, 2019 18:05

    Same merde here. Four hours into a fresh install of Unity, still no running .apk.

  2. Ca9ff6f9ef3cce7cd39ea49503ab08ca?d=mm

    filiw

    Dec 24, 2019 10:43

    Much appreciated. FYI, to fix OpenJDK I had to:

    chmod +x Editor/Data/PlaybackEngines/AndroidPlayer/OpenJDK/jre/bin/*
    chmod +x Editor/Data/PlaybackEngines/AndroidPlayer/OpenJDK/bin/*

  3. Ac99d557ca6e21acef564fe8c5df7d00?d=mm

    Skit5

    Dec 10, 2019 03:19

    The second point means you need to go there https://androidsdkmanager.azurewebsites.net/SDKTools
    Then download the tools and place them under the SDK folder

  4. 4bcce6540e9043e45e1993b4e441fe6a?d=mm

    LOLinc

    Dec 08, 2019 21:33

    I have installed all the android tools using the hub, but the editor does not recognize this, hence I'm not able to build: http://i.imgur.com/hukSwDH.png

  5. 60eb716e03fc822e0b8580ff8eb2287d?d=mm

    TashaSkyUpchurch

    Dec 07, 2019 21:48

    never mind tools can be downloaded directly:

    https://developer.android.com/studio?pkg=tools#downloads

  6. 60eb716e03fc822e0b8580ff8eb2287d?d=mm

    TashaSkyUpchurch

    Dec 07, 2019 21:43

    Great work on tracking all of this down. can you elaborate on

    2) Android SDK (Editor/Data/PlaybackEngines/AndroidPlayer/SDK) is missing ...

    Where can one get this tools directory and the contents that are needed?

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.