Update: Unity Hub Version 2.2.2 resolves the problem
Since around version 2.2.0 (can’t pinpoint the exact version, since I first didn’t connect the problem with UnityHub) the package manager won’t find git anymore. You can find more information about the problem here: Git support on Package Manager page-4#post-5239820
I noticed that git will be found by the Package Manager, if the project is started throgh the Unity exe itself instead of the hub. Therefore I guess something is wrong with the hub.
I tried uninstalling the hub, but I think I didn’t manage to completly uninstall it, since the problem did not disappear and I was still logged in and had my project list when I reinstalled the hub.
Since nobody else seems to have the problem, I hope that properly reinstalling the hub solves the problem.
Here are the steps I took:
Uninstall with Revo Uninstaller to remove installation and leftover registry entries
Delete folder %AppData%\Unity Hub
Delete folder %AppData%\UnityHub
Delete folder content of %LocalAppData%\Unity\cache
Empty CacheServer Content
Once I install the Hub and set my Unity installation folder, the project history is back and I’m logged in as well, so there seems to be something else.
Why does this happen and can I fix it, or is this a bug of the Hub? I use the hub since the preview version and was always quick to update to the next version if that is relevant.
About the Setup
Unity: 2019.3.0f1, 2019.2.10f1
UnityHub: 2.2.1
Windows: Windows10 Pro 1909
git version 2.24.0.windows.2
git-lfs/2.9.0 (GitHub; windows amd64; go 1.12.7; git 8ab05aa7)
Go to the version of Unity you last ran, then down to Editor/Data/Tools/RoslynScripts, open up “unity_csc.bat” and add “.exe” to the end of the command it’s calling, so it’ll look like:
@ OFF
set APPLICATION_CONTENTS=%~dp0…..
“%APPLICATION_CONTENTS%\Tools\Roslyn\csc.exe” /shared %*
exit /b %ERRORLEVEL%
How that manages to break git too is anyone’s guess
I had the same issue as Mark, my Unity projects all had some number of errors that looked like the attached image
But wouldn’t clear (like they were compile errors). The editor log was complaining about csc:
“is not recognized as an internal or external command,
operable program or batch file.”
but the path it was using (the path that the the above batch file command expands to) was fine when I ran it myself from CMD prompt.
Re-installing unity failed to fix the issue, deleting the library didn’t fix it either. I’m not sure what happened, but it’s a fun one
Very interesting, that fixed it for you?
I changed the script for 2019.2.14f1 and it didn’t help. For 2019.3 the script looks a bit different:
@ECHO OFF
setlocal
rem start with editor install layout
set CSC=%~dp0..\..\Tools\Roslyn\csc.exe
rem fall back to source tree layout
if not exist "%CSC%" set CSC=%~dp0..\..\csc\builds\Binaries\Windows\csc.exe
if not exist "%CSC%" (
echo Failed to find csc.exe
exit /b 1
)
"%CSC%" /shared %*
exit /b %ERRORLEVEL%
endlocal
Looks correct to me… at least the .exe is always set.
Just to be sure: Did you try adding a different repo or changing the version number? The packages are cached for each project and therefore won’t need git in order to be imported.
@Pyroka : Oh yeah, I had those errors without any content as well. Did you get your setup to work again?
We saw this issue as well. Ensuring that git (the correct version) is in the path and works from a base command line was the first step we took. Booting unity directly (not via Unity Hub) seems to have allowed us to get beyond the issue by installing UPM packages. Subsequent unity hub starts worked (probably because it wasn’t trying to install a UPM package). I suspect, as I think others have, that the environment Unity Hub sets up is not quite right with recent changes.
The way this fails results in a debugging path that has a very high cost - experiments to try to fix mean uninstalling/reinstalling unity, unity hub, git, or a whole code repository. Would be super nice to get this fixed ASAP so others don’t stub their toes like we did.