Unity and its faceplanting method of installing Android SDKs

Trying to build an Android project with Unity using Unity 2018 LTS.

First off you need to install the Android build support which you do in the Unity Hub. This, of course, doesn’t actually do anything. Maybe because I’m using Unity 201.4.23f1

and the docs its sends you off to older docs because older unity.  It tells you to install the Android Command Line tools…So I installed this but the SDK manager doesn’t work because apparently it has been deprecated. Unlike the Unity docs.

With all that time wasted now its time to try the other way by downloading the bloatware that is Android Studio
Of course there’s this disclaimer – they never fully tested it. What are the chances that’s there’s a problem?

anyhoo when its download and installed and you first open it you need to go to configuration here:

 

in SDK manager head to SDK tools and show Obsolete and tick ANDROID SDK tools (Obsolete):

Then you have to edit the Unity preferences to tell it where the SDK & NDKs are.
Obviously they get installed in default locations by Android studio and so of course Unity makes you look this info up on the internet so you can point Unity at them. Why Unity couldn’t know this, I have no idea.

SDK is here on my machine: C:\Users\info\AppData\Local\Android\sdk

But the NDK which should be in the folder is missing which means a pointless trip back to Android studio SDK tools to get it to install the NDK which is incidentally massive. It probably contains Call of Duty as an easter egg.

After that’s installed you can point the preferences at the NDK at which point Unity tells you that it wants a different version.

Why it couldn’t mention this beforehand escapes me completely – I leave it to students of UX design to never do something as fucking annoying as this ever.

 

Back in the Unity Preferences Garbage heap window, there is actually a Download Button that will get the right version that you manually put into an NDK folder inside the SDK folder .

Now happiness as Unity is finally satisfied and will build while recognising that my phone isn’t plugged in

 

 

Then we get to here

 

helpfully when you click on Ok it takes you to the correct page of the help docs -who am I trying to kid, the docs are here

https://docs.unity3d.com/Manual/TroubleShootingAndroid.html

one of the steps is to

Run the adb devices command from the platform-tools directory of your Android SDK installation and check the output.

which I did as an administrator and nothing happened at at all.

instead on the phone in the developer options I enabled USB debugging

 

then it said

 

you have to allow RSA key from the window on the phone

 

and that’s it!

 

Simple