Dinomite-Studios / unity-azure-pipelines-tasks

Azure DevOps extension adding tools to build and deploy Unity 3D projects using Azure Pipelines
https://unitydevops.com/
MIT License
121 stars 49 forks source link

Activate a pro licence with a custom project path failed #220

Open AntTBD opened 1 year ago

AntTBD commented 1 year ago

Hello, I tried to activate a pro licence with your task but it failed. When I look at log file, it says that packages are not found. In fact, I've 2 folders in my repo:

I added the 'unityProjectPath' parameter to point at my game folder but it seem that it's not taken into account. Of course, when I try the command with a cmd task it works fine! So I looked at your files and in your lastest release you remove this parameter :

const unityProjectPathInputVariableName = 'unityProjectPath';

const projectPath = tl.getPathInput(unityProjectPathInputVariableName) || '';

.arg('-projectPath').arg(projectPath)

So can you add it again or explain to me if I did something wrong? And at this step, is it necessary to build packages ? Thanks for all

FejZa commented 1 year ago

Hi @AntTBD, the projectPath CMD argument was removed because it is not needed to activate the editor with a license/seat. Previously it would cause a full import of the project before the activation took place.

Now this task is much faster since it simply activated the editor using an empty project.

Could you please share your log files for the failing activation?

AntTBD commented 1 year ago

Hi @FejZa ok thanks I understand and I totally agree with you on the duration of the task. With this comand I used with the basic command line task, it takes ~10min long:

"$(unity.installFolder)$(unitygetprojectversion.projectVersion)\Editor\Unity.exe" -projectPath "$(System.DefaultWorkingDirectory)\$(unity.projectPath)" -batchmode -quit -nographics -username $(unity.username) -password $(unity.password) -serial $(unity.serial) -logFile "$(System.DefaultWorkingDirectory)\Logs\UnityActivationLog_.log"

At the end of the process, I must also add the returnlicense command

Here is the log file (I'm trying to build the Unity Reflect Viewer project) (task duration before failed: ~4min):

LICENSE SYSTEM [2023314 13:53:12] Next license update check is after 2023-03-15T13:53:11

Built from '2020.3/release' branch; Version is '2020.3.12f1 (b3b2c6512326) revision 11776710'; Using compiler version '192528614'; Build Type 'Release'
OS: 'Windows Server 2019 Datacenter; OS build 17763.4010; Version 1809; 64bit' Language: 'en' Physical Memory: 7167 MB
BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1
[Package Manager] Server::Start -- Port 50069 was selected

 COMMAND LINE ARGUMENTS:
C:\Program Files\Unity\Hub\Editor\2020.3.12f1\Editor\Unity.exe
-batchmode
-quit
-nographics
-username
***
-password
(hidden)
-serial
(hidden)
-logfile
D:\a\1\s\Logs\UnityActivationLog_2023-03-14-13-52-49.log
D:/a/1/s
Using Asset Import Pipeline V2.
Rebuilding Library because the asset database could not be found!

[Package Manager] Done resolving packages in 189.99s seconds
An error occurred while resolving packages:
  Package com.unity.reflect.markers@file:D:\a\1\s\Packages\com.unity.reflect.markers has invalid dependencies or related test packages:
    com.yasirkula.nativeshare (dependency): Package [com.yasirkula.nativeshare@1.4.2] cannot be found
  Package com.unity.reflect.viewer-core@file:D:\a\1\s\Packages\com.unity.reflect.viewer-core has invalid dependencies or related test packages:
    com.unity.properties (dependency): Package [com.unity.properties@0.1.6-preview.2] cannot be found

A re-import of the project may be required to fix the issue or a manual modification of D:/a/1/s/Packages/manifest.json file.

Exiting without the bug reporter. Application will terminate with return code 1