Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android installer does not download the SDK, NDK and OpenJDK folders to PlaybackEngines/AndroidPlayer #239

Open
canxerian opened this issue Aug 4, 2022 · 4 comments

Comments

@canxerian
Copy link

Installing the Android module with Unity Hub and Install-UnitySetupInstance yield different results. Notably, the following folders are missing in Editor\Data\PlaybackEngines\AndroidPlayer with the latter:

  • NDK
  • OpenJDK
  • SDK

Repro:

Find-UnitySetupInstaller -Version '2020.3.37f1' -Components 'Windows','Android' | Install-UnitySetupInstance

@jwittner
Copy link
Member

jwittner commented Aug 4, 2022

UnitySetup predates UnityHub and discovers downloads by scanning the releases websites, downloads the components and invokes them itself. The Unity installer used to bundle the Android tools in with the component, but that was split at some point to avoid duplicates of the tools if you don't need them (you can set the paths for you Android build tools inside Unity).

I'd love to install the Android tools from UnitySetup, but installing Android requires accepting the license agreement and I'm not sure how best to go about that in an automated fashion that doesn't run afoul of some policy so I've avoided it so far.

Open to ideas though!

@mandalorianbob
Copy link

So I know UnitySetup predates the UnityHub, but can it use the UnityHub?

Apparently, "Unity Hub.exe" has a bunch of commands. I just got this in email when I complained to Unity that wasn't a way to headlessly install Android JDK/SDK/NDK tools:

The hub does support a command line to do the full installation, including Child Modules (Open JDK + Android SDK & NDK), this would be the command to install Android + the JDK & NDK to an existing Unity installation:

"Unity Hub.exe" -- --headless install-modules --version 2020.3.38f1 -m android --cm

To install it all from scratch then something like this should work:

"Unity Hub.exe" -- --headless install --version 2020.3.38f1 -m android --cm

Is the Hub installed with the Unity installation? Could Android be added on after the original install?

@jwittner
Copy link
Member

I think moving to UnityHub would be a great change, but also a large one that will need lots of testing for all the use cases included in UnitySetup, e.g. the DSC resources.

I'm not sure if the Hub comes along with Unity if it's installed with UnitySetup, we'd have to test that from a clean machine. I suspect Android could be installed after the original install, but it'd be another thing to test.

@khayamgondal
Copy link

Same problem, my android build requires NDK and installing via following wont install NDK
Install-UnitySetupInstance -Installers (Find-UnitySetupInstaller -Version '$(unitygetprojectversion.projectVersion)' -Components 'Windows', 'Android') -Verbose
@mandalorianbob did you test unity hub method with NDK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants