无法使用 Jenkins 构建 Unity 时将项目路径设置为:C:\Program



我是 Unity 和 Jenkins 的新手。我想使用 Jenkins 为我的公司项目构建自动构建,但在运行构建时出现错误。这是来自 Jenkins 的错误日志:

Building in workspace C:Program Files (x86)JenkinsworkspaceProject-Build
 > git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git.exe config remote.origin.url https://github.com/my-user-account/project.git # timeout=10
Fetching upstream changes from https://github.com/my-user-account/project.git
 > git.exe --version # timeout=10
 > git.exe fetch --tags --progress https://github.com/my-user-account/project.git +refs/heads/*:refs/remotes/origin/*
 > git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
 > git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 16d16a1ab2deb17ec18a4f3ab1b31170b534095b (refs/remotes/origin/master)
 > git.exe config core.sparsecheckout # timeout=10
 > git.exe checkout -f 16d16a1ab2deb17ec18a4f3ab1b31170b534095b
Commit message: "add builder script"
 > git.exe rev-list --no-walk e272f7767978e0af084b8a49e36385f833f7c6a9 # timeout=10
Piping unity Editor.log from D:KAIGAN
[Project-Build] $ "C:Program FilesUnityEditorUnity.exe" -quit -batchmode -projectPath C:Program Files (x86)JenkinsworkspaceProject-Build -executeMethod BuildScript.PerformAndroidBuild -logFile D:Custom FolderJENKINS_BUILDProject
LICENSE SYSTEM [20181224 6:7:44] Next license update check is after 2018-12-24T12:47:08

LICENSE SYSTEM [20181224 6:7:44] 00330-80123-38760-AA904 != 00330-80000-00000-AA766
Built from '2017.3/release' branch; Version is '2017.3.1f1 (fc1d3344e6ea) revision 16522547'; Using compiler version '160040219'
OS: 'Windows 10  (10.0.0) 64bit' Language: 'en' Physical Memory: 8144 MB
BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 0
[Package Manager] Server::Start -- Port 60900 was selected
 COMMAND LINE ARGUMENTS:
C:Program FilesUnityEditorUnity.exe
-quit
-batchmode
-projectPath
C:Program
Files
(x86)JenkinsworkspaceProject-Build
-executeMethod
BuildScript.PerformAndroidBuild
-logFile
D:Custom FolderJENKINS_BUILDProject
Couldn't set project path to: C:Program
(Filename: C:buildslaveunitybuildRuntime/Utilities/Argv.cpp Line: 226)

Aborting batchmode due to failure:
Couldn't set project path to: C:Program
FATAL: Unity3d command line execution failed with status 1
Build step 'Invoke Unity3d Editor' marked build as failure
Archiving artifacts
Finished: FAILURE

错误说

无法将项目路径设置为:C:\程序

但我没有得到它:(

我在我的Unity项目上使用了这个buildscipt:Buildscript.cs

我使用免费的统一版本。我使用安装了 jenkins 和 Unity 的 Windows 10。请帮助我

注释是正确的。您需要处理目录路径中的空格。如果您使用的是管道或批处理脚本,则可以使用类似的东西。

bat(script: ""%ProgramFiles%\Unity\Hub\Editor\2021.3.5f1\Editor\Unity.exe" any extra commands here" )

你可能想试试 Jenkins Unity 插件。它可以帮助管理 Unity 安装及其所在位置。https://plugins.jenkins.io/unity3d-plugin/

相关内容

最新更新