You are missing the recommended SDK/JDK/NDK/ Install the recommended version using Unity Hub
Asked Answered
C

7

6

So I've been getting these warnings in Unity 2019.410f1. Here's how it looks like:enter image description here

But when I go to Hub to fix this, those packages are already installed. enter image description here

However, there are no such folders in the directory where they are supposed to be (except for NDK folder, this one is fine). So here's my problem: JDK, NDK and SDK are NOT installed, but Unity Hub thinks overwise and doesn't let me install them. Reinstalling this version of Unity doesn't help either. Does anyone know what can I do to fix this?

Crowberry answered 18/9, 2021 at 9:32 Comment(1)
Same here. Such a pain looking for a solution. Hope this one works. Reporting here later how it went.Chane
A
5

the bug

There has been a bug in unity forever with those. The fix is, for jdk, sdk and ndk..

  • click copy path button,
  • untick the use version installed with unity box
  • paste in the path you just copied
  • (optional, save project and exit and repoen it)
  • Then just retick the boxes to put it back the way it was originaly

I dont think you are having this bug tho, your problem sounds different.

uninstall / reinstall

I'm really suprised uninstalling unity and reinstalling didnt fix it. Maybe try uninstalling all versions of unity + unity hub, restart machine and start again installing unity hub.

Manually download

If nothing else works I think this would, but its not pretty..

Manually download sdk, jdk and ndk, untick the boxes and add the paths where you have put them. The jdk and ndk can just be downloaded.

Anking answered 18/9, 2021 at 13:33 Comment(4)
The manual download actually helped, thank u! But now I'm facing a problem with ndk - unity is unable to detect it in the folder where I put it...Crowberry
So maybe u downloaded wrong thing? or maybe you are not pointing unity to the right folder, maybe u need to point to some subfolder like bin or something, I dont remember.. it should work tho. This was the only way of building to android in the past.Anking
So there was a problem with unpacking the archive, now everything's alright. Thank you so much!Crowberry
@Crowberry np! :)Anking
M
1

Here's the steps I used to fix this:

  1. Install and Open Android Studio
  2. Open the SDK Manager
  3. Copy the Android SDK Location (the SDK Manager shows this path)
  4. Optionally install any SDKs you want using the SDK manager
  5. Create a Symlink to point from the default Unity SDK folder to the default Android Studio SDK folder

On Windows, here's a symlink command you can use. You'll need to change the command to match the user on your system.

mklink /D "C:\Program Files\Unity\Hub\Editor\2020.3.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK" "C:\Users\YOUR_USER_HERE\AppData\Local\Android\Sdk"

Lastly, I had to refresh Unity to make the warning message go away. Open Unity -> Edit -> Preferences -> External Tools -> uncheck & re-check the Android SDK Tools

Monitorial answered 21/10, 2021 at 6:29 Comment(0)
V
1

For me (Unity 2021.2.18f1) the problem happened because the NDK field's default value was wrong. The NDK was correctly downloaded by Unity but the path in Unity Editor was wrong so I changed the path to the correct one.

Vindicate answered 14/4, 2022 at 0:10 Comment(0)
V
1

For me Unity 2021.3.6f1. I fixed by changing the permission of the whole unity editor folder:

sudo chmod -R 777 Editor/

It was a bit extreme, but it worked for me. It was the editor 2021.3.6f1 ubuntu 22.04

Vacuole answered 5/8, 2022 at 9:33 Comment(0)
M
1

I could reproduce this error when installing older Unity Versions (for me 2020.3.25f1) with Unity Hub 3.x. For some reason the newer Unity Hub doesn't install Android SDK & NDK and OpenJDK for older Unity versions. It's a weird bug, but happened to me every time and on different machines. Possible Workarounds:

  1. Manually install Android SDK, NDK & JDK and locate path in Unity Editor
  2. Use Unity Hub 2.X when installing older Unity Versions
  3. Install newer Unity Editor (e.g. 2021.3.10f1). For some reason sdk, ndk and jdk are properly installed here. You can either copy it over to the other Unity Editor installation (Might get a filename too long exception though) or just link to the path from the 2021 installation in your 2020 editor. Pay attention to the required version though. If there's a version missmatch this workaround doesn't work.

All in all weird bug, weird workarounds but for me all of them worked with the last one being the most convenient since I usually have the newest recommended version installed anyway :)

Manny answered 19/9, 2022 at 16:54 Comment(0)
S
1

One thing worked for me is to install the JDK manually. After unticking "JDK Installed with Unity" and clicking browse, unity detected the newly installed JDK automatically and asks to set it as default. So I clicked Ok. I did that with the SDK as well. and now it works for me although it still shows the warnings.

Shocking answered 20/11, 2023 at 14:29 Comment(0)
A
0

I had the same problem. After installing android studio and getting the sdk path from it, unity still did not accept the path as valid. So what I did was reinstalling the unity editor. In my case 2019.4.1, when installing it the "extra packages" dropdown menu will display and you can easily check the android packages and proceed. Now it perfectly works.

enter image description here

Ashton answered 22/8, 2023 at 21:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.