How to install Android build support with Unity Hub 3-beta
Recently I had to install Unity 2020.3.16f1 to update an old game developed with Unity 2017. This game was made for Android, and since I'm using Unity Hub 3.0.0-beta.2 (I'm only using it because it has a black theme), I had to install the required modules for "Android Build Support" to be able to compile the game and see if it worked with the new Unity version. It turns out that the installation of that modules is a bit buggy.
If you are trying to do the same (or close enough) and you are receiving the following message:
Failed to delete old Unity Android Support Installation files. Maybe Unity or some of its tools are still running?
Follow the next steps.
- Quit all Unity instances
- Quit Unity Hub (Ensure it is not still running on the system tray)
- Remove the next folder
Unity/Hub/Editor/2020.3.16f1/Editor/Data/PlaybackEngines/AndroidPlayer
in your Unity Hub's installation files - Edit
Unity/Hub/Editor/2020.3.16f1/modules.json
(you'll need admin privileges)(you can format the json file here) and update all related "android" items to has its property"selected"
tofalse
- Copy
Unity/Hub/Editor/2020.3.16f1/modules.json
toUnity/Hub/Editor/2020.3.16f1/modules.json.bk
(This is your backup) - Edit the file
Unity/Hub/Editor/2020.3.16f1/modules.json
and replace all the "android" related file paths using the following rule:- Rename
AndroidPlayer
toAndroidPlayerTmp
and the folder next toAndroidPlayer
(SDK, NDK, OpenJDK) to be the item's"id"
value - Example with item with
"id"
"android-ndk"
:"{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer/NDK"
->"{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayerTmp/android-ndk"
"renameFrom": "{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/android-ndk-r19"
->"renameFrom": "{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayerTmp/android-ndk/android-ndk-r19"
- Rename
- Start Unity Hub and install all "Android Build Support" related items
- Once it is finished, you should found a
{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayerTmp
folder with all the folders with the "id" names. If not, you can download the content from the property "downloadUrl" of the item (I had to do this with "android-sdk-platform-tools") - Copy each item folder content back to its "AndroidPlayer" original destination (You have this info in your
modules.json.bk
file) - Edit
Unity/Hub/Editor/2020.3.16f1/modules.json
android items file paths to their original value (You have this info in yourmodules.json.bk
file) - Unity should be able to compile your project for Android by now
Happy Game Dev! 👾
Tweet this