Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Android SDK not found

Discussion in 'Linux' started by Alesk, Oct 17, 2019.

  1. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    339
    Hi,

    I've made a fresh install of Unity 2019.2.9f1 using the Hub on my Linux Mint 19.1.
    In the process, I've checked then Android SDK installation as well.

    I've tried to use Unity Remote to test my project, but it just doesn't works.
    I've followed some tutorials describing what to do step by step, with no luck. And it seems I'm not alone on that topic... Nevermind...

    So I've tried to fallback to a plain simple Build to test my game... and it doesn't works as well !

    As explained here https://docs.unity3d.com/Manual/android-sdksetup.html
    The Android SDK seems to be properly installed in the right path.
    In my case : "/home/alesk/Unity/Hub/Editor/2019.2.9f1/Editor/Data/PlaybackEngines/AndroidPlayer"

    But when I try to build it, I've got these error messages :

    Code (CSharp):
    1. UnityException: Android SDK not found
    2. Unable to locate Android SDK.
    3. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /home/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    Code (CSharp):
    1. Build completed with a result of 'Failed'
    2. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /home/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    Code (CSharp):
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    2.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in /home/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:190
    3.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in /home/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:95
    4. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /home/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

    It seems that the problem is somehow related to IMGUI, but I couln't find the file "GUIUtility.cs" anywhere on my computer.

    I've also tried to Build a fresh new empty project, and I have the same errors.

    If someone has some clues on how to fix that... I would be more than happy ;)
     
    PsijicNine and n4n0basti like this.
  2. jounisuominen

    jounisuominen

    Joined:
    Nov 6, 2018
    Posts:
    5
    Same here, tried manually installing Android SDK and NDK-16b and setting the path in Unity Preferences but no luck..
     
    PsijicNine likes this.
  3. OldHaggis

    OldHaggis

    Joined:
    Oct 7, 2019
    Posts:
    2
    Hi,

    I've also have been getting this issue with Unity 2019.2.8f1 (Hub 2.1.2, Ubuntu 18.04). The SDK appears to be installed in the correct path (~/Unity3d/Unity/Editors/2019.2.8f1/Editor/Data/PlaybackEngines/AndroidPlayer/SDK)

    Building gives me these errors :

    Code (CSharp):
    1. UnityException: Android SDK not found
    2. Unable to locate Android SDK.
    3. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun() (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:122)
    Code (CSharp):
    1. Build completed with a result of 'Failed'
    2. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun() (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:122)
    Code (CSharp):
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    2.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in /home/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:190
    3.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in /home/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:95
    4. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun() (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:122)
     
    PsijicNine likes this.
  4. mcpebooster

    mcpebooster

    Joined:
    Jan 28, 2018
    Posts:
    4
    I have the same problem...
     
    PsijicNine likes this.
  5. Muhamad_Faizol

    Muhamad_Faizol

    Joined:
    Jan 21, 2017
    Posts:
    47
    Please check if there is "tools" folder in Unity/Hub/Editor/<Unity version>/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/. If the folder is not there, then you can download Android SDK from Google and copy that folder after unzipping the SDK into Unity's folder.

    Hope that helps.
     
  6. mcpebooster

    mcpebooster

    Joined:
    Jan 28, 2018
    Posts:
    4
    Yes this folder is there...
     
  7. Muhamad_Faizol

    Muhamad_Faizol

    Joined:
    Jan 21, 2017
    Posts:
    47
    Hmm... Last time the "tools" folder wasn't installed by Unity and that was the case for the SDK not found problem. If everything is installed properly (SDK, NDK and Java), then perhaps try comparing the SDK files downloaded from Google and the ones in the Unity folder? I no longer download the SDK/NDK supplied by Unity as I have multiple Unity versions installed so it's just easier to have Unity to use my system wide SDK/NDK to save space.
     
  8. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    339
    "tools", "build-tools" or "platform-tools" ?

    I have 3 folders here :
    "build-tools"
    "platforms"
    "platform-tools"

    But not "tools" only
     
  9. Muhamad_Faizol

    Muhamad_Faizol

    Joined:
    Jan 21, 2017
    Posts:
    47
    "tools" only. This folder is with the official SDK from Google, but somehow Unity didn't include it with their SDK package.
     
  10. jounisuominen

    jounisuominen

    Joined:
    Nov 6, 2018
    Posts:
    5
    Upgraded to 2019.2.10f1 and I copied the "tools" folder from an Android SDK installation to PlaybackEngines/AndroidPlayer/SDK/ but didn't help. Still getting "Android SDK not found".

    Another maybe related issue: when I go to Preferences to edit Android SDK location I get this error to console on every button press:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.Android.SDKManager..ctor () (at <24d9b022aa584914af833273ea899103>:0)
    3. UnityEditor.Android.SDKManager.GetInstance () (at <24d9b022aa584914af833273ea899103>:0)
    4. UnityEditor.Android.AndroidPreferenceWindowExtension.WritePreferences () (at <24d9b022aa584914af833273ea899103>:0)
    5. UnityEditor.PreferencesProvider.WritePreferences () (at /home/builduser/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:818)
    6. UnityEditor.PreferencesProvider.ApplyChangesToPrefs (System.Boolean force) (at /home/builduser/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:535)
    7. UnityEditor.PreferencesProvider.ShowExternalApplications (System.String searchContext) (at /home/builduser/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:381)
    8. UnityEditor.PreferencesProvider.OnGUI (System.String searchContext, System.Action`1[T] drawAction) (at /home/builduser/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:307)
    9. UnityEditor.PreferencesProvider+<CreateExternalToolsProvider>c__AnonStorey1.<>m__0 (System.String searchContext) (at /home/builduser/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:210)
    10. UnityEditor.SettingsProvider.OnGUI (System.String searchContext) (at /home/builduser/buildslave/unity/build/Editor/Mono/Settings/SettingsProvider.cs:103)
    11. UnityEditor.SettingsWindow.DrawControls () (at /home/builduser/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:322)
    12. UnityEditor.SettingsWindow.DrawSettingsPanel () (at /home/builduser/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:313)
    13. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at /home/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:298)
    14. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at /home/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:483)
    15. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at /home/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:466)
    16. UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at /home/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:447)
    17. UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /home/builduser/buildslave/unity/build/Modules/UIElements/Events/MouseCaptureDispatchingStrategy.cs:93)
    18. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /home/builduser/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:280)
    19. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at /home/builduser/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:156)
    20. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at /home/builduser/buildslave/unity/build/Modules/UIElements/Panel.cs:190)
    21. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /home/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:255)
    22. UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /home/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
    23. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /home/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    24.  
     
    ina likes this.
  11. jounisuominen

    jounisuominen

    Joined:
    Nov 6, 2018
    Posts:
    5
    I found a solution that works for me. I made yet another installation of Android SDK and NDK with Android Studio and set those to Unity preferences and then they were accepted by Unity.
     
    HieRow likes this.
  12. senkal_

    senkal_

    Joined:
    May 22, 2018
    Posts:
    86
    Last edited: Dec 29, 2019
  13. RetroZelda

    RetroZelda

    Joined:
    Jan 8, 2013
    Posts:
    6
    the furthest I can get is when building with il2cpp I get Failed running /opt/Unity/2019.2.17f1/Editor/Data/il2cpp/build/il2cpp.exe with various *.o files giving Native error= Access denied

    with another error line spitting out Exception: /opt/Unity/2019.2.17f1/Editor/Data/il2cpp/build/il2cpp.exe did not run properly!

    I have tried running as root as well as changing user/group permissions on both the editor and the project folders

    I am also unable to get the SDK that is delivered with Unity working, its the SDK from the android package manager. But the NDK from the package manager doesnt work, so I have it pointing to the one that comes with unity.

    linux support is still very messy and its disappointing that I have to run a win10 vm just to get a packaged build to work
     
  14. senkal_

    senkal_

    Joined:
    May 22, 2018
    Posts:
    86
  15. slembcke2

    slembcke2

    Joined:
    Jun 26, 2013
    Posts:
    270
    After ~4 hours of trying to get the UnityHub version working, waiting for downloads, reimports, etc, I pointed it at my local install and it worked just fine. (Whatever the latest version the SDK the Ubuntu package for Android Studio installed.)

    Annoyingly, I was about to put in the paths for this when my co-worker strongly advised my to let Unity install it, as I would likely have problems to no end if I let Unity do it. (facepalm) Oh well, hindsight is 20/20.
     
  16. lzbk

    lzbk

    Joined:
    Dec 3, 2017
    Posts:
    10
    Two versions of unity both time with the "android module" checkbox checked, tried every folder from either my sdks (apt-get / downloaded from https://developer.android.com/studio/releases/sdk-tools extracted in an AndroidPlayer/SDK folder) and I'm giving up… So much time lost :(
     
    PsijicNine and Kaweri like this.
  17. unity_giiLLQ6PE-cPfQ

    unity_giiLLQ6PE-cPfQ

    Joined:
    Mar 18, 2020
    Posts:
    1
    Hi guys,
    I had the same problem and I solve it, I have to say that i am working on windows, but i think this will work for ubuntu too.
    First of all, you download from the android studio page, at the end of the page you will have the zips with the sdk packages, download it, after unziping it you will see that it's only a folder inside called tools.
    then in unity, in preferences, you have to put the path to this folder or to the upper directory.
    then you go to build settings and click on build.
    after this you will have to click on update while its building the apk.
    After this it will work.
     
    ashygoyal, RafaNobre and RowEtermax like this.
  18. Deleted User

    Deleted User

    Guest

    Although everyone seems to be talking about Unity 2019, the title says "Android SDK not found", so I try too.
    I'm running 2018.4.19f1. Building Android from the editor, works. building via commandline does not. Since the error only says:
    Code (CSharp):
    1. DisplayProgressbar: Detecting Android SDK
    2. UnityException: Android SDK not found
    3. Unable to locate Android SDK.
    How Do I know where Unity is even trying to look for the right version? It's correctly set and usable in the Editor preferences but refuses to be found from CommandLine
     
  19. LocoJosh

    LocoJosh

    Joined:
    Feb 15, 2020
    Posts:
    4
    I just was able to find the Android SDK using Command-Line-Tools.
    Inside the 'Android-sdk' folder (or whatever name you give it) you should have the following folders : build-tools, platforms, platform-tools and tools.

    I renamed the folder 'command-tools' to just 'tools' and my "Android SDK not found" problem was solved.
    Hope it is of help
     
  20. tsudheer

    tsudheer

    Joined:
    Dec 8, 2019
    Posts:
    2
    after this you will have to click on update while its building the apk. - can you elaborate on this? What do you mean by clicking on update?
     
  21. RowEtermax

    RowEtermax

    Joined:
    Dec 27, 2016
    Posts:
    1
    This works.
     
  22. bulut5151

    bulut5151

    Joined:
    Nov 15, 2017
    Posts:
    1
    Open android studio > click configure > sdk manager > sdk tools > hide obsolete packages > android sdk tools (obsolete) click > apply
     

    Attached Files:

  23. db2android

    db2android

    Joined:
    Mar 14, 2020
    Posts:
    1
    Many thanks! It works
     
  24. AnnLee2020

    AnnLee2020

    Joined:
    Apr 13, 2020
    Posts:
    1
    Thank you so much!
     
  25. pererahasala

    pererahasala

    Joined:
    Sep 13, 2014
    Posts:
    1
    This Worked. Thank You very much
     
  26. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    223
    Hitting this one too. 2018.4
     
  27. victorbijl

    victorbijl

    Joined:
    Dec 9, 2019
    Posts:
    1
    |SOLUTION|

    Reinstall SDK into a different folder (Create one using the EDIT function

    After this, Connect your phone via usb, open remote, open unity, set folder, press play and voila
     
    bzkarcade likes this.
  28. manildayma

    manildayma

    Joined:
    Mar 17, 2019
    Posts:
    4
    I downloaded 2019.4 thrice and 2019.3 version as well but every time I get this "Unable to detect Android SDK." My project is felt in between. What shall I do ?
     
  29. manildayma

    manildayma

    Joined:
    Mar 17, 2019
    Posts:
    4
    I tried, it is not working
     
    PsijicNine likes this.
  30. hermetic

    hermetic

    Joined:
    Jan 24, 2018
    Posts:
    11
    Hmm, I was able to solve this on 19er unity by giving the unity- android chmod -R 755 rights. Sadly now on new 20 unity, the same 'android not found' bug appears again and worse my old project don't want to compile anymore because deprecated oculus/VR modules. It's a mess unity!
     
  31. KevinWelton

    KevinWelton

    Joined:
    Jul 26, 2018
    Posts:
    239
    The current state with the latest builds (and as far back as 2019.4) is such that your best bet is to install with the Hub. Installing with the hub will allow Unity to install the Android players, as well as the SDK and NDK. If you install with the standalone editor installer / downloader, you will get the Android players, but not the SDK and NDK. You can tell if this has been done because your "Unity/Editor/Data/PlaybackEngines/AndroidPlayer" folder will have "NDK" and "SDK" subfolders.
     
  32. hermetic

    hermetic

    Joined:
    Jan 24, 2018
    Posts:
    11
    @KevinWelton Thank you for fast reply and for your work. But I did install all with HUB:

    :~$ cd Unity/Hub//Editor/2020.1.5f1/Editor/Data/PlaybackEngines/AndroidPlayer/

    :~/Unity/Hub/Editor/2020.1.5f1/Editor/Data/PlaybackEngines/AndroidPlayer$ ll
    4096 Sep 10 17:52 Apk/
    4096 Sep 10 17:52 Data/

    4096 Sep 10 17:55 NDK/
    4096 Sep 10 17:55 OpenJDK/
    4096 Sep 10 17:53 SDK/

    4096 Sep 10 17:52 Tools/

    So OpenJDK, NDK and SDK and all bin is there.

    If I go on EscapeRoom Project (Unity tutorial) in Edit->Preferences->External Tools it complains:
    '! You are missing the recommended Android SDK Tools Install the recommended version using Unity Hub.'

    on File->Build Settings->Android unity complains:
    'Android SDK and/or JDK directory is not set'.

    (I think the other both JDK and NDK are now found after my rights change, I will try to reproduce and test that, would be nice if you could try that on a linux-workplace too. I'm using ubuntu, but don't think it's a distro problem).

    This bug is there since years, would be nice if on next version it could be fixed without users need to do workarounds.
    Keep up the good work on unity! ;)
     
  33. francopenizzotto

    francopenizzotto

    Joined:
    Feb 2, 2020
    Posts:
    5
    Awesome, it works.
     
  34. francopenizzotto

    francopenizzotto

    Joined:
    Feb 2, 2020
    Posts:
    5
    I use that method, with Unity 2020.2.0f1, I did not work for the SDK. I had to manually update the SDK with android studio and then set the path in Unity preferences (only for the SDK, not the rest such a NDK).
     
    jgarcia_db likes this.
  35. abdoonn

    abdoonn

    Joined:
    Apr 13, 2020
    Posts:
    1
  36. jgarcia_db

    jgarcia_db

    Joined:
    Nov 13, 2020
    Posts:
    1
    Bro, how did you do that?? Can you help me?? I got the same version of Unity like you and I have the same problem...
     
  37. SavageProgrammer

    SavageProgrammer

    Joined:
    May 20, 2021
    Posts:
    1
    This is not the S***!!! I mean why we download SDK and NDK separately! What the hell unity team doing then
    (-10/10)
     
    d1favero, oleg_v and SirBarkley like this.
  38. wildanprima97

    wildanprima97

    Joined:
    Jul 26, 2021
    Posts:
    1
    Hello Everyone. I have the same problem as well. I downloaded and installed Unity version 2021.1.15f1 with android SDK, JDK, and NDK from Unity Hub version 2.4.4. I've tried to manually download the SDK files and replace it in SDK directory but it is not working. I've also tried to check Android SDK tools (Obsolete) method but it is still not working. Please kindly help me fix this issue.
     
    Last edited: Jul 26, 2021
  39. Little-Phoenix

    Little-Phoenix

    Joined:
    Apr 25, 2021
    Posts:
    1
    Hello Everyone I had the same problem as well. I downloaded and installed Unity version 2020.3.4 with android SDK, JDK, and NDK from Unity Hub version 2.4.4. All of you try and install android studio to find the sdk and jdk and copy that path and paste in build
     
  40. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    68
    2020.3.11f1, the same. Installing from Hub gives wrong SDK structure (not expected by Unity itself, ha).
    Installing from google gives other errors related to versions inconsistency.
    And there are no more docs: 2018 docs was about manual installation and 2020 only about Hub install.

    Looks really weird, 2017-2018 (last time I used Unity to build for Android) all was fine.
    2020 - all is broken: NDK installed only after 3rd try, SDK - wrong installation.
    But why?
    If Unity needs special versions of SDK/NDK, just bundle them and give access via Hub or download link.
    But... no.

    UPDATE (solved)
    My problem (besides missing cmdline tools) was in parallel installation of Java 15, but Android SDK is mostly working with 8.
    So solution was:
    1. set JAVA_HOME and Path to Java 8 (installed by Unity Hub, see in Unity prefs for External tools)
    2. Restart all opened cmd/terminal instances and Unity for sure :)
    3. Ensure all Android options are checked (all default path) beyond the "External tools" in Unity Preferences and there are no Yellow warnings
    4. Build apk :)
     
    Last edited: Aug 21, 2021
  41. VJPPaz

    VJPPaz

    Joined:
    Jun 19, 2018
    Posts:
    1
  42. robbiehunsinger

    robbiehunsinger

    Joined:
    Dec 23, 2020
    Posts:
    2
    so this is really too basic and weird but I got the same error- no android SDK and when I went to copy the path of the SDK in preferences the backslash before the SDK folder was a forward slash. Not Kidding. I corrected this and pasted it into the preferences with a forward slash and now it builds at least to the point to tell me I need a different numbered SDK. I hope this helps someone else. What a basic bug- I can hardly believe it. Hopefully now I can get the correct SDK installed. No more SDK not found error! So change
    C:/Program Files/Unity/Hub/Editor/2019.4.34f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK
    to
    C:/Program Files/Unity/Hub/Editor/2019.4.34f1/Editor/Data/PlaybackEngines/AndroidPlayer/SDK

    This was incorrectly installed with that error directly from the Unity Hub
     
  43. ViktorCor

    ViktorCor

    Joined:
    Jul 22, 2012
    Posts:
    13
    I had a similar problem, searched all the forums, nothing helped.

    In the end, I solved it by installing JDK 8, setting JAVA_HOME in Environment Variables, and the path to install JDK.
    And also downloaded the latest Unity Hub 3.0.1 and installed Unity from it.
    After that, everything worked.

    Not sure what helped exactly, the latest Unity Hub or adding JAVA to Environment Variables...
     
  44. LudovicArnould

    LudovicArnould

    Joined:
    Jan 29, 2022
    Posts:
    4
    Hi,
    I don't know if it's the right place but I arrived here after facing a similar issue. To sum up, I installed Unity 2020.3.26f1 from Unity Hub 3.0.1 and I am running on Ubuntu 20.04.3 LTS. I also installed JDK and SDK from Unity Hub, but with default paths in Preferences -> External tools, I had a building error "JDK directory is not set or invalid" which was solved by installing JDK8 manually and then changing the path to /usr/lib/jvm/java-1.8.0-openjdk-amd64. Then I had an error related to AndroidPlayer/SDK which I understood to be related to the sdkmanager program which could not execute a "--list" command. Manually installing Android SDK gave me the "SDK not found" error even after changing the path.
    It solved by adding the original hub installed AndroidPlayer/SDK/tools/bin directory to PATH in ~/.bashrc and setting "authorize the file to execute as a program" on in sdkmanager property (and then giving the same authorisation to SDK/platform-tools/adb".
     
  45. SurreyMuso

    SurreyMuso

    Joined:
    Mar 16, 2020
    Posts:
    63
    This also worked for me. I'm building for Oculus Quest 2 on a Mac. Was fine before I updated Visual Studio to 17.3 but then the error occurred. Following these instructions sorted everything out. Thank you!
     
  46. SurreyMuso

    SurreyMuso

    Joined:
    Mar 16, 2020
    Posts:
    63
    Slightly different instructions (using Android Studio Chipmunk 2021.2.1 Patch 1 on a Mac Studio Ultra):

    Android Studio > Customise > All Settings > System Settings > Android SDK

    Select "SDK Tools" tab then uncheck "Hide Obsolete Packages"

    Select "Android SDK Tools (Obsolete)" and Apply

    However, full credit to @bulut5151
     
  47. luispuertolas

    luispuertolas

    Joined:
    Sep 26, 2017
    Posts:
    7
    So I had the same error but kept reading the compiler log, which mentioned an error about the android manifest. So every time I get this error, I delete the android manifest. A new correct manifest will be generated on build and your code will run.
     
    Last edited: Dec 23, 2022
  48. justinexige20066

    justinexige20066

    Joined:
    Dec 18, 2022
    Posts:
    15
    I have same problem too I use ver5.6.4p and 2023.3 sdk and jdk error
     
  49. RichAllen2023

    RichAllen2023

    Joined:
    Jul 19, 2016
    Posts:
    1,026
    My Bold.

    I don't think this year's version of Unity's gone LTS yet, you'd be better off using an earlier one.
     
  50. justinexige20066

    justinexige20066

    Joined:
    Dec 18, 2022
    Posts:
    15
    ok then so is it still possible to build for android with version 5.6.4p2 without LTS