@@ -3287,8 +3287,9 @@ async function getSdkManager(rootEditorPath) {
32873287}
32883288async function getAndroidSdkPath(rootEditorPath, androidTargetSdk) {
32893289 logger.ci(`Attempting to locate Android SDK Path...\n > editorPath: ${rootEditorPath}\n > androidTargetSdk: ${androidTargetSdk}`);
3290- const sdkPath = await (0, utilities_1.ResolveGlobToPath)([rootEditorPath, '**', 'PlaybackEngines', 'AndroidPlayer', 'SDK', 'platforms', `android-${androidTargetSdk}/`]) ;
3290+ let sdkPath;
32913291 try {
3292+ sdkPath = await (0, utilities_1.ResolveGlobToPath)([rootEditorPath, '**', 'PlaybackEngines', 'AndroidPlayer', 'SDK', 'platforms', `android-${androidTargetSdk}/`]);
32923293 await fs_1.default.promises.access(sdkPath, fs_1.default.constants.R_OK);
32933294 }
32943295 catch (error) {
@@ -4677,19 +4678,23 @@ class UnityHub {
46774678 finally {
46784679 this.logger.endGroup();
46794680 const match = output.match(/Assertion (?<assert>.+) failed/g);
4681+ const retryConditions = [
4682+ 'async hook stack has become corrupted',
4683+ 'failed to download'
4684+ ];
46804685 if (match ||
4681- output.includes('async hook stack has become corrupted' )) {
4686+ retryConditions.some(s => output.includes(s) )) {
46824687 this.logger.warn(`Install failed, retrying...`);
46834688 return await this.Exec(args);
46844689 }
4685- if (exitCode > 0 || output.includes('Error: ')) {
4686- const error = output.match(/Error: (.+)/);
4690+ if (exitCode > 0 || output.includes('Error')) {
4691+ const error = output.match(/Error(?: given)?:\s* (.+)/);
46874692 const errorMessage = error && error[1] ? error[1] : 'Unknown Error';
46884693 switch (errorMessage) {
46894694 case 'No modules found to install.':
46904695 break;
46914696 default:
4692- throw new Error(`Failed to execute Unity Hub: [ ${exitCode}] ${errorMessage}`);
4697+ throw new Error(`Failed to execute Unity Hub (exit code: ${exitCode}) ${errorMessage}`);
46934698 }
46944699 }
46954700 output = output.split('\n')
@@ -5318,12 +5323,12 @@ done
53185323 return JSON.parse(modulesContent);
53195324 }
53205325 async installUnity(unityVersion, modules) {
5321- this.logger.ci(`Installing Unity ${unityVersion.toString()}...`);
53225326 if (unityVersion.isLegacy()) {
53235327 return await this.installUnity4x(unityVersion);
53245328 }
53255329 if (process.platform === 'linux') {
53265330 const arch = process.arch === 'x64' ? 'amd64' : process.arch === 'arm64' ? 'arm64' : process.arch;
5331+ // install older versions of libssl for older Unity versions
53275332 if (['2019.1', '2019.2'].some(v => unityVersion.version.startsWith(v))) {
53285333 const url = `https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb`;
53295334 const downloadPath = path.join((0, utilities_1.GetTempDir)(), `libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb`);
@@ -5349,6 +5354,7 @@ done
53495354 }
53505355 }
53515356 }
5357+ this.logger.ci(`Installing Unity ${unityVersion.toString()}...`);
53525358 const args = ['install', '--version', unityVersion.version];
53535359 if (unityVersion.changeset) {
53545360 args.push('--changeset', unityVersion.changeset);
@@ -5364,11 +5370,13 @@ done
53645370 args.push('--cm');
53655371 }
53665372 const output = await this.Exec(args, { showCommand: true, silent: false });
5367- if (output.includes(`Error while installing an editor or a module from changeset`)) {
5373+ if (output.includes(`Error while installing an editor or a module from changeset`) ||
5374+ output.includes(`failed to download.`)) {
53685375 throw new Error(`Failed to install Unity ${unityVersion.toString()}`);
53695376 }
53705377 }
53715378 async installUnity4x(unityVersion) {
5379+ this.logger.ci(`Installing Unity ${unityVersion.toString()}...`);
53725380 const hubInstallDir = await this.GetInstallPath();
53735381 switch (process.platform) {
53745382 case 'win32': {
0 commit comments