Jenkins一鍵打包unity遇到的坑:C:\Windows\System32\config\systemprofile... could not be found

記錄一個困擾了半天的坑。

 

Jenkins安裝並設置好所有環境變量的前提下,打unity的AssetBundle,發現怎麼都無法生成AB資源。然而控制檯輸出的log日誌看起來也是successfully。並且同樣的代碼和命令行語句,直接在命令行執行就可以打出響應的包,Jenkins卻不行,困擾了好久。

這是Jenkins打包之後最後輸出的log:

Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.185450 seconds (Nothing changed)
[Package Manager] Server::Kill -- Server was shutdown
Cleanup mono
Exiting batchmode successfully now!
debugger-agent: Unable to listen on 5416
Finished: SUCCESS

可以看到,似乎也是successfully。

但是然後定位到error信息:

-----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp.dll
Compilation failed: 1 error(s), 0 warnings
-----CompilerOutput:-stderr----------
error CS0006: Metadata file `C:/WINDOWS/system32/config/systemprofile/AppData/LocalLow/Unity/cache/packages/packages.unity.com/[email protected]/UnityEngine.StandardEvents.dll' could not be found
-----EndCompilerOutput---------------
- Finished compile Library/ScriptAssemblies/Assembly-CSharp.dll
error CS0006: Metadata file `C:/WINDOWS/system32/config/systemprofile/AppData/LocalLow/Unity/cache/packages/packages.unity.com/[email protected]/UnityEngine.StandardEvents.dll' could not be found

可以看到"xxxx could not be found",發現是unity打包環境響應的文件沒有找到,但是定位到那個文件夾下,確實是有這個文件的。

一頓百度Google之後,有人說是重置網絡,有人說是關閉防火牆,還有說是關閉安全管家,統統試了一遍都不好使。

終於:

下面是解決方法:

————————————————————————————————————————————————————

1. 打開windows服務,找到Jenkins服務。(在運行界面輸入services.msc然後回車)


2. 在登錄賬戶頁面設置爲本機電腦的賬戶,然後點擊確定。(似乎是Jenkins安裝的時候自己弄了一個賬號,而那個賬號無法訪問c盤下的文件夾,訪問不了unity打包的相關組件)
3. 之後記得重啓Jenkins服務
4. 再試試Jenkins打包,是不是ok了呢。
 

感謝萬能的baidu和google吧,這個是搜索關鍵字:

Jenkins C:\Windows\System32\config\systemprofile  could not be found

然後解決的,記錄一下吧。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章