Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

326
Views
Unity cannot recognize some .cs files after pulling a project from git

I am currently developing a project using Unity 2020.3.3f1. I use git version control system and store my project in a Bitbucket repository. When I clone / pull my project to another computer (especially with macos) some of my cs. files are displayed as an unknown file` (not a script) in the project view, and some other classes cannot find the class defined on that file. When I right click and select "reimport" the cs file, recovered immediately and I build successfully.

This causes me a problem when I try to build my project through Unity Cloud build, because I get an error about some missing classes which are indeed there.

[Unity] Initialize engine version: 2020.3.6f1 (338bb68529b2)
3: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/ToonyColorsPro.Editor.dll
4: [Unity] Assets/JMO Assets/Toony Colors Pro/Editor/Shader Generator/Config.cs(192,13): error CS0246: The type or namespace name 'MaterialLayer' could not be found (are you missing a using directive or an assembly reference?)
5: [Unity] Assets/JMO Assets/Toony Colors Pro/Editor/Shader Generator/ShaderProperty.cs(417,40): error CS0246: The type or namespace name 'MaterialLayer' could not be found (are you missing a using directive or an assembly reference?)
6: [Unity] Assets/JMO Assets/Toony Colors Pro/Editor/Shader Generator/Config.cs(173,59): error CS0246: The type or namespace name 'MaterialLayer' could not be found (are you missing a using directive or an assembly reference?)
7: [Unity] Assets/JMO Assets/Toony Colors Pro/Editor/Shader Generator/Config.cs(192,13): error CS0246: The type or namespace name 'MaterialLayer' could not be found (are you missing a using directive or an assembly reference?)
8: [Unity] Assets/JMO Assets/Toony Colors Pro/Editor/Shader Generator/ShaderProperty.cs(417,40): error CS0246: The type or namespace name 'MaterialLayer' could not be found (are you missing a using directive or an assembly reference?)
9: [Unity] Assets/JMO Assets/Toony Colors Pro/Editor/Shader Generator/Config.cs(173,59): error CS0246: The type or namespace name 'MaterialLayer' could not be found (are you missing a using directive or an assembly reference?)
10: ! build of 'default-ios-ad-hoc' failed. exit
11: publishing finished successfully.
12: Finished: FAILURE

After that I tried pulling the project from a Mac device, the project also could not recognize the same MaterialLayer.cs. I easily recovered using "reimport". My project settings / Asset Serialization : Force Text and "Version Control / Visible Meta Files" are already set.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

It's a long shot and I write answer only because I can attach image here:

Every file in C# solution has properties:

enter image description here

So my suggestion is to double check if those "missing", "unknown" .cs files have same properties set as those .cs files, which are recoginzed correctly.

over 4 years ago · Santiago Trujillo Report

0

If you using LFS on git then this issue sometimes happens when LFS pulled with a bug or metafiles was broken during pulling files, please double check your .gitattributes. It's possible that the merge option for .meta was wrongly assigned. I'm using this .gitattributes for my projects, still no issues with this.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!