简体   繁体   中英

How to install android build support for unity manually (unity hub)?

I used Unity Hub downloaded latest Unity Editor, it works fine for editor,document and language packs, but can not download android build support. Just told me download failed many many times in the past two days.

So I downloaded UnitySetup-Android-Support-for-Editor-2018.2.16f1.pkg from webpage. This package install reported failed at the end of every try.This package size(348.9M) is not same as the one showed(365.8M) in UnityHub download list.

There is a 2017 version Unity Editor installed by download **.pkg, but the support installer never ask me about Editor's location.

Is there some way to install android build support manually?
Thanks for any tips.

This worked for me. To anyone facing this problem. I apologize for my long explanation and my english.

You can verify if *.pkg file is complete by comparing the checksum (I use dolphin )

Execute this command to manually install your UnitySetup-Android-Support-for-Editor-*.pkg

:~> ./UnitySetup-2019.1.0f2 -u --use-component-list unity-2019.1.0f2-linux.ini --install-location $HOME/2019.1.6f1/ -d $HOME

Note that the unity version must be compatible, otherwise you will have the error unable to initialize the Unity engine in you android device. I use:

UnitySetup-Android-Support-for-Editor-2019.1.6f1
Unity-2019.1.6f1

As much as possible use unity hub to install the android add-on, I use unity hub 2.0.1

Step by step explanation of the installation manually of *.pkg

The problem :(

I will put them in context.

I use opensuse tumbleweed. My problem was that I did not have android build support. No Android module loaded image , and when I press open download page, the browser shows me a message:

<Error> <Code>AccessDenied</Code> <Message>Access denied.</Message> <Details> Anonymous caller does not have storage.objects.get access to publishing-unity-binaries-prd/6e9a27477296/Unknown/UnitySetup-Android-Support-for-Editor-2018.3.0f2. </Details> </Error>

and I can not do anything else.

The SOLUTION :)

0.- Previous requirements

I already had my previous installation this file:

UnitySetup-2019.1.0f2

1.- Download UnitySetup-Android-Support-for-Editor-2019.1.x.pkg

To achieve this look for UnitySetup-Android-Support-for-Editor- in the file https://public-cdn.cloud.unity3d.com/hub/prod/releases-linux.json

This is a fragment of release-linux.json file

... { "id": "android", "name": "Android Build Support", "description": "Allows building your Unity projects for the Android platform", "downloadUrl": "h ttps://download.unity3d.com/download_unity/f2970305fe1c/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2019.1.6f1.pkg", "category": "Platforms", "installedSize": 1958542000, "downloadSize": 664332318, "visible": true, "selected": false, "destination": "{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer", "checksum": "d00addecefb7babcb9cd6a8085672908" } ...

What interests us about this file is the url to download https://download.unity3d.com/download_unity/f2970305fe1c/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2019.1.6f1.pkg and the checksum.

2.- Component list file

Download the file from the list of components from here or create a file like unity-2019.1.0f2-linux.ini :

[Android]
title=Android Build Support
description=Allows building your Unity projects for the Android platform
url=MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2019.1.6f1.pkg
md5=d00addecefb7babcb9cd6a8085672908
install=true
mandatory=false
size=365578263
installedsize=1259081000
requires_unity=false

for [Android] install=true , the url and md5 which is the checksum from the previous step (or again I get md5 with dolphin to verify)

3.- Installation

Have the following files in the same directory that in my case are in $HOME

UnitySetup-2019.1.0f2 
UnitySetup-Android-Support-for-Editor-2019.1.6f1.pkg
unity-2019.1.0f2-linux.ini 

Finally, execute the following command line. (Note that my current unity installation is in $HOME/2019.1.6f1/).

:~> ./UnitySetup-2019.1.0f2 -u --use-component-list unity-2019.1.0f2-linux.ini --install-location $HOME/Unity-2019.1.6f1/ -d $HOME

Thanks

Source

https://forum.unity.com/threads/installing-android-build-support-and-other-build-support-post-installation.515436/

https://forum.unity.com/threads/how-to-install-editor-packages.554977/

Download the Android Sdk Manager under Command line tools only. And download the SDK you need, then link it to Unity.

I usually download AndroidStudio and it comes with a GUI manager. Here is some more info about how to update sdk tools.

You link it here: Edit/Preferences/External Tools在此处输入图片说明

According to this:

Possible causes could be:

A corrupt package (download again manually from the list of individual packages)

Filesystem corruption (repair disk from single-user mode, reboot and try again)

The user account somehow not being in the sudoers group (deeper technical problem - check Apple's forums)

Package file stored on a drive formatted weirdly, so execute permissions aren't set correctly (pre-/post-installation script won't run; move to boot drive)

Add Unity modules on Linux manually:

  1. Download pkg:

    Head to this page, select your specific unity version from the dropdown at the right.
    For those modules that arent listed in linux section, download the pkg from the mac section.


  1. Extract the pkg. you can use any of these:
    • Files
    • Archive Manager
    • 7z x -o* UnitySetup-XXXXXX-Support-for-Editor-2022.1.16f1.pkg
    • bsdtar -xf UnitySetup-XXXXXX-Support-for-Editor-2022.1.16f1.pkg TargetSupport.pkg.tmp/Payload

  1. Move the extracted "Payload" file to one of these directories:

    • For Android Build Support:

    {UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer

    • For Windows Build Support (Mono) & Widows Dedicated Server Build Support:

    {UNITY_PATH}/Editor/Data/PlaybackEngines/WindowsStandaloneSupport

    • For Mac Build Support (Mono) & Mac Dedicated Server Build Support:

    {UNITY_PATH}/Editor/Data/PlaybackEngines/MacStandaloneSupport


4. Now decompress and extract Payload:
cpio -iu < Payload~ && rm Payload~

or if it's named Payload~ just extract it:

 cpio -iu < Payload~ && rm Payload~ 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM