Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Please make android SDK downloadable without the hub

Discussion in 'Unity Hub' started by Yukken, Apr 18, 2019.

  1. Yukken

    Yukken

    Joined:
    Jul 12, 2015
    Posts:
    93
    I've been banging my head against this issue for a while day. I had to install unity 2019.1 without the hub because the it kept refusing to connect to the internet. After that I've been trying to install the android SDK but I can't find a way to do so. There is no way to add modules to unity installations that were installed without the hub. I can't use the hub to just download the SDK seperately either. The unity editor is always checked in the download box. The offline download assistant doesn't set up the android SDK. The SDK version isn't mentioned anywhere so I can't just download the latest version and be done. The manual page simply tells me to use unity hub aaand we are back to square one.

    Honestly, every unity update has been a pain to migrate to but this one takes the cake. All I want is to make an android build.
     
  2. Deleted User

    Deleted User

    Guest

    The Android SDK is available in Visual Studio; maybe it can work with Unity?

    Capture.JPG
     
  3. JC-Cimetiere

    JC-Cimetiere

    Unity Technologies

    Joined:
    May 8, 2014
    Posts:
    123
    Hello,
    if you can't use the Hub, the easiest would be to get the required components via Android Studio
    https://developer.android.com/studio
    You need then to make sure you have Android 9/28 SDK
    You also need Android NDK r16b (which can be found directly as well here: https://developer.android.com/ndk/downloads/older_releases.html)

    Then follow instructions in the "Using an alternate Java Development Kit, Android SDK, or NDK" section of the doc https://docs.unity3d.com/Manual/android-sdksetup.html
    to setup the correct path.

    I hope this helps.
     
  4. Yukken

    Yukken

    Joined:
    Jul 12, 2015
    Posts:
    93
    I'll try it out. Setting up android studio will be a pain but I guess I have no choice. Thanks.
    In the future, please make it possible to use the hub to download the SDK separately for the installation. Or make it work with the Download Assistant. It's not possible to pause a download when using the hub or see the download speed. This makes the hub useless if you happen to have an unreliable internet connection.
     
  5. Deleted User

    Deleted User

    Guest

    The Hub v2 offers that possibility.

    Capture.JPG
     
    Shodan0101 likes this.
  6. Yukken

    Yukken

    Joined:
    Jul 12, 2015
    Posts:
    93
    That's only IF you installed 2019.1 through the hub. You can't add modules if you install it without the hub. You also CAN'T just download the SDK from the hub.
     
  7. Deleted User

    Deleted User

    Guest

    That how things work; you must now use the Hub to install and use Unity. Your download problems can probably be fixed.
     
  8. Yukken

    Yukken

    Joined:
    Jul 12, 2015
    Posts:
    93
    I don't want to start a flame war here. Unity still provides a direct download for everything else. For whatever reason, they didn't include the SDK there. As I've mentioned again and again, the hub has connectivity problems. I've also seen other forum posts mentioning this. If they want to push the hub, that's fine. But there should always be alternatives
     
  9. lostplesed

    lostplesed

    Joined:
    Mar 26, 2014
    Posts:
    25
    i can't download latest version from unity hub, so i choose a older one. but the download progress bar never finished. so i download the lastest version from unity download archive web page.but when i open the editor. i can't download the android ndk from click a button (old version support). please add a simple download button, it will save a lot of works. thanks!
     
    Kaweri and araz01 like this.
  10. StudioZooka

    StudioZooka

    Joined:
    Oct 20, 2018
    Posts:
    4
    My Unity Hub 2.1 is not showing the option for Modules with the version 2019.1.6f1 but an older version (2018.2.4f1) have the option.
     
  11. Deleted User

    Deleted User

    Guest

    That's because you didn't install 2019.1.6f1 from the Hub but by using the usual installer. If you had installed it from the Hub, you would get the option.

    Capture.JPG
     
    Shodan0101 and safaGH like this.
  12. Karsten

    Karsten

    Joined:
    Apr 8, 2012
    Posts:
    187
    This is rediculous, if you have for example Unity 2019.1.3 then it disapears in the hubs list of versions after a while when newer versions came up and you dont have a chance to add modules later, you eighter have to update your Unity always to the newest (a big challenge with this fast update cycles) or you fall behind.
    The whole "DevOps" Unity tries to present to us with all the services and hub ect is in a very brittle state these days, and I cant wait for the day when everything works together properly
     
    flowerrj123 likes this.
  13. FURKANKAHVECI

    FURKANKAHVECI

    Joined:
    May 12, 2013
    Posts:
    27
    Every freakin time downloading android sdk&ndk module for every unity update. WHY? Unity hub is big ssd freaker...
     
    araz01 likes this.
  14. Kiour_gr

    Kiour_gr

    Joined:
    Dec 6, 2017
    Posts:
    18
    Hello I am a technician for a university and would also be interested in a way of downloading the android sdk and ndk tools without the Hub. We used to install unity through SCCM (Microsoft's System Center Configuration Manager). We used to install unity automatically but now I need to do it manually on 100+ computers though the hub. :-(
     
  15. JC-Cimetiere

    JC-Cimetiere

    Unity Technologies

    Joined:
    May 8, 2014
    Posts:
    123
    Hello,
    you can still make offline installs and then build your scripts to install Unity, see https://docs.unity3d.com/2019.2/Documentation/Manual/InstallingUnity.html
    the installation of Android NDK/SDK is a convenience we provide, but you can decide to manage your own install
    https://docs.unity3d.com/2019.3/Documentation/Manual/android-sdksetup.html
    Android NDK/SDK are downloaded from Google servers and require a license agreement (shown in the hub), so we won't include them in silent/offline installs scenarios.
    You can get Android NDK/SDK from https://developer.android.com/ and then build your own deployment configuration.

    JC
     
    Kiour_gr and AbrahamDUnity like this.
  16. Kiour_gr

    Kiour_gr

    Joined:
    Dec 6, 2017
    Posts:
    18
    Thanks JC for the instructions and the reasoning for not having a standalone due to licencing , that now makes sense!
     
  17. Max_Bol

    Max_Bol

    Joined:
    May 12, 2014
    Posts:
    168
    The Unity HUB is basically useless for some of us because it's really badly made.
    If you allow me the crack-joke, it's Fallout76-like quality made.

    Basically, the most broken part of it is that it's unable to hold and manage packages properly.
    • If your connection fluctuate, the download fails 1 package and it stop, the download fails.
    • If your download speed isn't on par with the Unity server, a single package lost, the download fails.
    • If your anti-virus analyse anything a tad too much, the download fails.
    • If you're using a HDD and it takes a tiny bit of time to write the data (even at 10,000RPM), the download fails.

    The solution is actually quite simple and has been known by Unity since day 1 of the release of Beta HUB.

    The solution:
    Build a proper package management that can locate missing package and requests packages individually from the server as well as properly caching them when something goes wrong so that it can be resumed afterward. This what is done with the Installer version and this is why almost nobody have any issues with using the Installers.

    The reason that was given why the HUB wasn't done the same way as the Installers is to reduce the stress on Unity file's server. In other word, no practical reason for the user. But because the HUB fails miserably for many users, Unity is forced to keep the Installer around or they would loose quite a big chunk of their users in a single night. hence the original reason is foolish and useless at this point.
    The team is supposed to be working on adding a proper package management and I have seen it being pointed out since the early stage of HUB. We'll know when it will be done by having a "Pause" and "Resume" button added to the downloads in the HUB. (This is a proof that the download is properly cached and its package are identified because, when pause, the connection is severed and resumed when unpaused which then check what has been done and what remains. This also works at overcoming the problems (points) above.)

    The 2 temporary solutions until the download manager of the HUB is fixed (which might never happens) are as following:

    1) Give links toward the right external packages that properly works with unity.
    You don't even have to add any stress on the server. Just point out the proper procedure to get everything when not from Unity itself nor the HUB. For example, where do we get the Android SDK and NDK that works with Unity 2019.x The SDK is well documented on the forum, but the NDK is still a mystery of tries and error done by the users where a simple message from an Unity devs stating "Hey guys, this is the link to download the right NDK from the Android website" would even do it. But no, it's total silence because you keep promoting the useless Unity HUB.

    2) Add it to the Android packages from the Installer.
    Currently, the Android package downloaded from the Installer only contains the JDK. It doesn't contain the SDK which can be downloaded via the Android Studio nor the NDK which is version sensitive such as you can't 99.99% of the ones available and must track down 1 that works. By the way, each NDK is approx. 700MB in size which means you got download about 100GB worth of NDK and only 1 or 2 of them will work. Really practical, right?

    I'm sorry if I sound negative in this post, but let me explain to you what I have lived through for the last week:
    • Trying to build an Android APK with mono backend (doesn't requires the Android NDK) results in missing codes being stripped from the build. It's the result of the limitation from CiL being unable to properly convert complex switch() statements. The solution is to build with il2cpp backend and force-reduce the stripping. To build with il2cpp backend, you need the Android NDK.
    • I tried many things with Mono backend, but all failed.
    • I tried to get multiple version of the NDK around the forum said to work. None does with neither 2019.2f0 nor 2019.2.6f1. The one I had worked with 2018.x, but not with 2019.x
    • Unless some magic happens in the next 6 hours, I'm missing the GDWC 2019 even if I was done with my project 1 week ago. All that because of the fact that the HUB doesn't work for me.
    • I'm also working for some customers as a Graphic designer and I have been squeezing my time so much I barely sleep 4 hours/day. All because I wanted to be done for the GDWC 2019 with this project on which I have worked for 2 months non-stop.

    I really though about shooting myself yesterday when I had to face the fact that it's quasi-impossible for me to build my game properly and that's the fault of whoever though it would be a good idea to make Unity HUB as it's currently is. I have invested everything on this project of mine and all it requires is a proper build now.

    I'm quoting your answer because that actually enraged me.

    That answer you gave is what makes me highly think of uninstalling Unity and simply use Unreal which, currently, has a proper download manager, works wonderfully with Android (with a bit of work) and on which I have yet to face the kind of issues I have faced with Unity. I have been using Unity for the last 5 years and, for all this time, I usually though and respected the team behind it, but you, I don't respect you because your answer points out as the exact answer from the typical "answer-by-the-sheet" customer service pion that work in a IT center that shrug their shoulder when something in the system they are representing simply doesn't work as it should.

    I said my piece and now I'm back at trying to fix the damn thing that got broken because of the Unity HUB limitation.
     
  18. FURKANKAHVECI

    FURKANKAHVECI

    Joined:
    May 12, 2013
    Posts:
    27
    Why "Unity Hub" developers do not read what we write.I have no respect for their lazy work.
     
    Last edited: Dec 24, 2023
    olivier_henley likes this.
  19. afshinity

    afshinity

    Unity Technologies

    Joined:
    Jul 31, 2017
    Posts:
    334
    Hi @Max_Bol & @FURKANKAHVECI,

    This is Unity Hub lead developer here.

    First of all, I would like to apologize for the inconvenient experience that you had, and I am trying to share your pain and concerns within the Unity Android team and my team to be able to prioritize this issue or find a short term workaround.

    I understand your frustration, but I want to emphasize that @APSchmidt is a wonderful member of the Unity community (not a Unity employee), and she is trying to help. I respect her effort to help and I hope you do so!

    Best,
    Afshin



     
  20. cxgrebe

    cxgrebe

    Joined:
    May 20, 2019
    Posts:
    4
    I'm trying to manually install the Android SDK, as per the documentation noted above. Regarding the SDK it says:
    "Unity works with the most recent version of the Android SDK available at the time of the Unity version release."

    I'm using Unity 2019.2.9f1. Based on this then I assume I should be using Android 9 Pie (API 28) which was released August 6, 2018.

    I tried this, and it worked... EXCEPT it seems to only work on phones that have Android 9 installed. I have Android 8.1 installed on my phone and when I go to the Google Play store I get the message "Your device isn't compatible with this version." My son has Android 9 on his phone, and he can install the app.

    My question is... if I use the Android 9 Pie SDK does it only target Android 9 devices? Should I be downloading multiple SDKs in order for the build process to produce multiple APKs in the ABB (Android App Bundle). I have the "Build App Bundle (Google Play)" option checked in the Unity Build Settings/Android. I believe Google now requires us to use the ABB to reduce file size. At least I couldn't get my app accepted unless I did.

    Thanks for any help you can offer. I'm new to unity and this is my first android app.
    Charles
     
  21. cxgrebe

    cxgrebe

    Joined:
    May 20, 2019
    Posts:
    4
    I just realized I wrote ABB when it should be AAB. My noobie status is on full display!
     
  22. sachinbirajdar

    sachinbirajdar

    Joined:
    Feb 23, 2017
    Posts:
    11
    So what version of android sdk is supported for unity 2019.2
     
  23. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    For any potential future reader, it is enough to have only a single platform-api level installed with the SDK (such as API 28). This is the level that should be selected as target api level in Unity editor (alternatively "automatic, highest installed" can be selected in the editor as well). There is also a minimum api level setting in the Unity editor. This setting specifies on which devices your app can be installed. If the minimum api level is set to 28, then the app can only be installed on devices with Android 9 or newer OS version. It's recommended to set minimum api level to as low as possible for the app (this mostly depends on what java / android APIs are used in the app and some custom manifest configurations. If none of them are used by plugins or scripts, then minimum api level can be set to the lowest that is available in the Unity editor).
     
    Last edited: Jan 22, 2020
  24. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    Android SDK version is not as strict as the NDK version. All supported Unity versions should work with the latest officially released (not beta and not release candidate) SDK tools version.
     
  25. sachinbirajdar

    sachinbirajdar

    Joined:
    Feb 23, 2017
    Posts:
    11
    Okay. Got it.
     
  26. CulpeoStudios

    CulpeoStudios

    Joined:
    May 26, 2017
    Posts:
    8
    My issue with the hub connection is. When I try to add the module Android SDK and NDK, I get a message in the lower part of the HUB that says "server is currently unresponsive". I don't have any connection issues with my internet and I even turned off the firewall and anti-virus.
    I've tried also using the ones from Android Studio in unity but they don't seem to work correctly. I get the yellow warning saying they aren't from the hub downloader.
     

    Attached Files:

  27. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    The warning about not using recommended tools is just a warning. If you have downloaded versions of NDK and SDK compatible with Unity, you should be able to build without issues.
     
  28. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    It's 2020, and ... UnityHub is still broken, won't install JDK, won't install anything except "I will FORCE you to download the latest version of Unity! (which you can't use on your project anyway, because it has regression bugs, but eh - who cares?)".

    It was such a good idea, that's been turned into such a toxic irritating thing that simply gets in the way and stops us from doing work :(.
     
    olivier_henley and harmakhis like this.
  29. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    I particularly like that the 2019.3 docs are simply delusional and in denial, with the quote:

    https://docs.unity3d.com/2019.3/Documentation/Manual/GettingStartedAddingEditorComponents.html

    "For information on adding the Android modules:

    ...where the second link goes to a page:

    "Use the Unity Hub to add additional components to installations ...[and then grudgingly admits that it only works with copies that Hub downloaded itself, which is rather documenting the failure than documenting how to achieve the title of the document!]"

    ...which of course has never been implemented, and apparently won't be - the goal is to stop people using the Editor, and force them to use Hub. This is how you make people hate a piece of software that they would otherwise have happily used :(.
     
    Last edited: Mar 13, 2020
  30. cmueck

    cmueck

    Joined:
    Mar 23, 2020
    Posts:
    1
    You can download Components for different Unity Versions from their Website
    https://unity3d.com/unity/whats-new/2019.3.0
    For other versions use the drop down on the right side.

    As mentioned before, SDK and NDK are not downloadable via those links, as both need an agreed License.

    For NDK the Unity Docs say which version are needed:
    Unity version | NDK version
    2017.4 LTS | r13d
    2018.4 LTS | r16b
    2019.1 | r16b
    2019.2 | r16b
    2019.3 | r19​
    You can find them here: https://developer.android.com/ndk/downloads/older_releases (Sadly r19 is only available via version r19c, don't know if that is fine as well :/ )

    About SDK Version, please see posts above. Installing the target platform seems to be enough.
     
  31. dm_bond

    dm_bond

    Joined:
    Sep 19, 2011
    Posts:
    62
  32. adityacr709

    adityacr709

    Joined:
    May 24, 2020
    Posts:
    2
    Is there any way I can download and set preferences for android and finally build the game I made.
    Someone, please help me with this
     

    Attached Files:

  33. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    Please see this page on how to set up for Android development https://docs.unity3d.com/Manual/android-sdksetup.html
     
  34. adityacr709

    adityacr709

    Joined:
    May 24, 2020
    Posts:
    2
    I am making a 3D zig-zag game and I am having a problem because the direction of the ball is not changing and it doesn't change if I click with the left mouse button.
    Someone please help me:(
    This is my code:


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. public class BallController : MonoBehaviour
    5. {
    6.    [SerializeField]
    7.    private float speed;
    8.     Rigidbody rb;
    9.     void Awake(){
    10.      rb=GetComponent<Rigidbody>();
    11.     }
    12.  
    13.    void Start(){
    14.     rb.velocity=new Vector3(speed,0,0);
    15.    }
    16.    void Update()
    17.     {
    18.         if (Input.GetMouseButtonDown(0))
    19.         {
    20.             SwitchDirection();
    21.         }
    22.     }
    23.     void SwitchDirection(){
    24.        if(rb.velocity.z > 0){
    25.            rb.velocity=new Vector3(speed, 0, 0);
    26.        }
    27.        else if(rb.velocity.x > 0)
    28.        {
    29.            rb.velocity=new Vector3(0, 0, speed);
    30.        }
    31.    }
    32. }
    33.  
     
  35. RigoCL

    RigoCL

    Joined:
    Sep 22, 2015
    Posts:
    9
    Hi, just wanted to share my experience on the Hub matter as I'm having the same problem downloading 2019.4 LTS using the Hub 2.3.2, meaning that some problems with the Hub still exist.

    The download process finished with no problem at all, but when installing, it's failing for me already many times. First try, the installation process suddenly stopped, don't know why as I wasn't watching and no error was shown, after checking what was installed, "Report a Problem with Unity", "Unity Documentation" and "Unity Release Notes" were correctly installed, but "Unity" (Editor) was not installed, the Hub shows "No Editor". Second try, though already downloaded, the Hub downloaded all again, almost 2.4 Gb which is quite silly by the way, this time the installation process shows "(queued)" in the Hub, don't know what the hell that means, but installation never ended. Had to remove/uninstall everything, after some other tryes I quit using the Hub and downloaded directly and installed 2019.4 (download page is not easy to find from main page by the way), but then Hub still showed "No Editor", so I had to uninsall the Hub and install it again, now it recognizes the Editor.

    At this very moment, I have no Android SDK installed, so I will use links provided here to do it manually, as the Hub doesn't allow me to add this component to the already installed Editor.

    Regards.
     
  36. kishore_1234

    kishore_1234

    Joined:
    Aug 14, 2017
    Posts:
    8
    Hi i installed 2019.4.6f1 and 2019.4.5f1 and still iam not able to get android sdk api 29 , because from august 1 all the apps uploaded to play store should have max api level to 29 , please provide me update link to api 29. In the drop down it is showing api 29 and api 30 when building it is asking to update , and i am trying to update and the error message is unable to update api 29 , asking me to update manually . please provide some answer
     
    Antan, yesemenovagames and pyx_orel like this.
  37. Antan

    Antan

    Joined:
    Jun 22, 2017
    Posts:
    5
    I too had problems with this on 2019.4. There is no way of updating the sdk to api 29/30 in Unity Hub. Upping the target api in [Project Settings > Player > Other Settings] makes Unity ask to update the sdk during the build, but the update fails.

    I instead downloaded Android Studio and installed the sdk through the SDK Manager. Then, in Unity [Preferences > External tools], just appoint the newly installed sdk. Unity now thought the Sdk was version 0.0 and tried to update it, failing again. But choosing "Install with highest installed API" or similar, it would still build and Google Play console recognised it as api 30.

    Android Studio: https://developer.android.com/studio
     
    Last edited: Aug 18, 2020
  38. harmakhis

    harmakhis

    Joined:
    Nov 15, 2019
    Posts:
    8
    Wanted to chime in here with my own experience.

    I live in a rural area, and my only means of internet access is through a horrendous satellite connection. Connectivity routinely drops out entirely--say, once every 10-15 minutes--and download speeds are abysmal.

    As such, I've been stuck trying to set up a Unity project for three weeks now. The Unity Hub is, as others have noted, absolutely useless. Without feedback of any sort other than "Download corrupted or incomplete," it fails to fetch any assets greater than about 500MB.

    And by this point, Unity seems to depend on the Hub to do all dependency management. So I've had to dig into forums, install Android Studio, download several different versions of the Android NDK onto my phone (more reliable connection, but without hotspot ability), then transfer to my PC, only to be told, "[despite what existing documentation says] this NDK is incompatible with Unity xxxx.x.xxxx." I'm currently having a fight with the Android SDK, as Unity apparently dislikes the version installed by Android Studio, and I'm getting stuck on the Gradle portion of the build command.

    I'm completely exasperated as to why Unity would place such heavy reliance on so integral a portion of its project setup process on something so fundamentally broken. I've been a professional software developer for 4 years at this point, and the Unity project setup is the worst, hands down and bar none, that I've ever encountered.

    I strongly, strongly suggest that Unity prioritize fixing this part of your software above all others, because I will guarantee you unequivocally that you're driving developers away. My team and I, who are developing a VR application in our off-hours, are an inch away from making the switch to Unreal, on the basis of this experience alone.
     
    tahdnt1 and a436t4ataf like this.
  39. dm_bond

    dm_bond

    Joined:
    Sep 19, 2011
    Posts:
    62
    There are many ways to download, configure and use Unity without using Hub. You can download Unity setup parts via torrent. How configure you already found (but apparently not fully understood). You can run Unity via command line parameters.
    I doubt that Unreal will set up the environment itself.

    If you want help, it is more useful to specify the exact version of Unity and what exactly does not work.
     
  40. olivier_henley

    olivier_henley

    Joined:
    Aug 14, 2012
    Posts:
    7
    Guys, thank you, seriously thank you. I was about to put my house on fire before finding this thread.

    Reading your experience calmed me, it was needed. I realize I am not alone, I am not certifiably nuts in this madhouse.

    - Which professional company releases a gut-wrenching core user tool without a) all the needed bells and whistles and b) properly testing it? Man, this thread dates spring 2019 ... 2021 is at the door and nothing has been fixed.

    - Unity forum mods, please put a leach on your community users trying to be self-righteous telling others 'how it works now'. Look, we know how 'it is supposed to work now', we just found it is broken for all practical manners and we are losing serious and precious time here. We just want to click buttons, accept licenses and have files installed at the proper place on our drives. No rocket science here.

    - Do not persist the insanity, just drop the tool, defund the team and come back with a new version when it works, like you know, normal 2021 software (progress bar, resumable, robust on unreliable connections, no useless notion of a stateful installation (installed with hub or manually changes what you can do afterward... my head hurts, how, what the ...?)

    - Unity devs, at least publish documentation explaining how to manually install all Android 3rd party needed until the Hub or an installer works correctly.

    - Community driven crypto wallets work better than this UnityHub... find the guys on LinkedIn and give them the job.

    To stay sane, I had to express myself. Thank you.
     
    Last edited: Sep 30, 2020
  41. Delusional85

    Delusional85

    Joined:
    Oct 25, 2020
    Posts:
    1
    I apologize for dropping in late to the party... new user here, since I learned that unity is the best engine for mobile platforms... I wanted to try it out... even if I use Godot and unreal... Unity 2D seemed fascinating to me... but! Unity hub!!! can't even download editor.. let alone the rest of the modules... but no worries there.. I managed to download editor 2019 LTS and android support module (which again doesn't work!) Yet I managed to get ndk and sdk... and jdk and gradle separately... now my biggest issue is.... people said here android sdk version isn't important... but... what??? why??? it can't recognize sdkmanager.bat??? no matter which version I put, no matter where I put tools..... it simply just doesn't work! ugh... I give up...
     
  42. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    OK, so today I had an idea to workaround this bug (amusing side-note: even Unity 2020 tells you to "click here to install the Android build tools" and then fails half way because the Unity team removed half the installer :)).

    Steps:

    1. Install one copy of Unity using the Hub (yes, sorry. But only need do it once, ever!)
    2. Make a fake project (if you don't already have one) in that copy of Unity (you need to do this because the Hub won't even let you use the UnityEditor any more!)
    3. In your fake project, set it up for Android builds: from Build Settings install the Android plugins
    4. ... and if it doesn't do it automatically: on the Edit > Preferences > External Tools page, get it to auto-install the NDK/SDK/OpenJDK (Unity used to do this itself, before the Hub team removed this core feature)

    (you can/should test this works - can you make a build of your fake project and have it appear on your phone? If not, everything else will fail: for some reason your copy of Unity is corrupt / your phone is broken and nothing will work for you, sorry)

    Then, for all your other - non-Hub! - copies of Unity:

    5. Install the Android build tools (from the Build Settings dialog) - this part is now broken because it will only go halfway, to try and force you to delete your copy of UnityEditor (!) and use the Hub instead.
    6. When you're finished, builds will silenty fail. But if you go to Edit > Prefernces > External Tools you'll see an Android section with 3 failed installs: NDK, SDK, and OpenJDK

    (annoyingly, Unity shows them with "warning" symbols even though Unity knows that's incorrect: they should be "error" symbols as they prevent you from building)

    7. In Unity 2020 (from memory this is still broken in Unity 2019 - from memory, I think I filed a bug about 8 months ago but it was rejected) - it will tell you which folders SHOULD be there and what locations Unity requires (in 2019: there was no way to know what these magic folder-names were!). They will look something like:

    C:\apps\Unity2010.1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK

    Now you need to:
    8. Find your Hub-installed copy of Unity, and look for the equivalent folders, something like:

    C:\apps\UnityHubInstalls\Unity2010.1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK

    WINDOWS:
    9. Open a Command Prompt in Administrator mode (Start Menu > run > "cmd" but before you hit enter click the "run as administrator" button)
    10. Change directly to the folder for your "real" Unity install (NOT the Hub install). e.g.

    cd C:\apps\Unity2010.1\Editor\Data\PlaybackEngines\AndroidPlayer\

    11. Create a folder-symlink to the Hub-installed copy of each of the missing folders, using "mklink /D (copy) (original)". NOTE: Microsoft got the arguments of that command the wrong way around, which is confusing. Be careful! e.g.

    mklink /D SDK C:\apps\UnityHubInstalls\Unity2010.1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK
    mklink /D NDK C:\apps\UnityHubInstalls\Unity2010.1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
    mklink /D OpenJDK C:\apps\UnityHubInstalls\Unity2010.1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK

    12. Restart your UnityEditor, and go to Edit > Prefernces > Extdrnal Tools - the errors/warnings should now have disappeared and it will happily use/share the Unity-Hub provided copy of Android

    I was afraid that there might be incompatibilities, but .... Unity is still using massively out-of-date copies of Android (They are so out of date that Google officially refuses to support them! But that's Unity's only allowed version. Sigh), so it seems we're locked to the old Android code anyway. And that means it works equally well in all versions of Unity.
     
  43. tanisha62183

    tanisha62183

    Joined:
    Nov 22, 2020
    Posts:
    6
    hey, i don't know if anyone will be able to help me out or not or even reply, but I really need your help, as I have some college project going on and the deadline is on my neck rn.
    So the thing is, i had previously installed unity 2019.4.13 and it also had some problems, but after some fixes i was able to solve them and it was working fine, then in the middle of my project i got this pop up that there is some new version available and with my previous experience, i downloaded the latest 2019.4.15 version and my "BIGGEST" mistake was to delete the previous perfectly working version of unity, and not its been 3 days, i m constantly facing errors of sdk. i reinstalled android studio and yet the problem is still solid.
     
  44. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    You should specify what errors you get or what exactly does not work for you.
     
    tanisha62183 likes this.
  45. tanisha62183

    tanisha62183

    Joined:
    Nov 22, 2020
    Posts:
    6
    Thank you for your reply, the problem i was facing back then was invalid android sdk problem, it came after i installed latest version of android studio and used its sdk file instead of the one which comes with the editor while downloading from unity hub because the sdk file was kind of empty( my editor was not able to detect any sdk file there in the path, some files were missing), so to overcome it, i uninstalled both unity hub and unity versions that i had (2018 and 2019), and tried reinstalling it, and now even after trying for more than 4 hours, 3 different versions, from unity hub and unity archive, on 2 different devices (laptop and pc) i m left with nothing, i only have a unity hub that isn't working, every time i try installing from it, after complete download animation it shows that the version couldn't download as the file was corrupted or something. If you can help me with this, then please, m about to have a nervous breakdown here.
     
  46. tanisha62183

    tanisha62183

    Joined:
    Nov 22, 2020
    Posts:
    6
    upload_2020-11-25_11-57-9.png upload_2020-11-25_11-57-14.png

    this is the error that i m facing and it is same for different paths(for the sdk downloaded with unity and sdk present in android studio)
     
  47. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    The keyword in your error is "INSTALL_FAILED_USER_RESTRICTED". This does not indicate that the SDK is not detected or does not work correctly. It means that the device rejects app installs. Do you have a xiaomi device? Googling the error leads to multiple pages with instructions on what settings have to be changed in the device to allow apps to be installed. Here's one of those pages https://stackoverflow.com/questions...estricted-android-studio-using-redmi-4-device
     
  48. tanisha62183

    tanisha62183

    Joined:
    Nov 22, 2020
    Posts:
    6
    Thank you! I did realise that it was the device's error.
    Also it is a small suggestion, if possible, please make sdks and ndks and jdks and gradles available seperately in the hub, because i m not able to use all these downloaded with the editor(from hub) for some reason, they always tends to show that the folder is empty or something similar, for this i had to spend many days trying to figure out what to do, espl. Sdk, the one i downloaded from other sources is just, outdated and m not able to use it properly yet again, bt it still gets the work done for me. And this is not only with me, but other users too.
     
  49. Midiphony-panda

    Midiphony-panda

    Joined:
    Feb 10, 2020
    Posts:
    243
    Bump

    To automatize Unity and Unity modules installation on new machines (new users/build machines), this can be tedious to install/locate the Android SDK/NDK and Open JDK each time.
    This would be very convenient to have at least the option to install them from the Android Support setup executable.

    What would be the recommended solution for this use case ?
    Should we use Unity Hub also for build machines ?
     
  50. BenjiM_Unity

    BenjiM_Unity

    Unity Technologies

    Joined:
    Aug 8, 2017
    Posts:
    163
    Thank you so much for the feature request, I’ve gone ahead and documented the details and shared it with the team.
     
    CandraWi and Midiphony-panda like this.