Hi.
I spent way too much time fixing an issue I had when trying to build my project using IL2CPP, but I finally managed to make it work and wanted to share the solution in case anyone encounters this problem in the future. When investigating this issue I spent hours looking through forums/Reddit/etc. and did not find even one mention of the problem, let alone any talk about a possible solution.
Basically, if this is the error you see in Editor.log when building your project with IL2CPP…
Fatal error in Unity CIL Linker
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
… then make sure that your root project directory does not contain any empty files whose names are similar to either your own assemblies or Unity’s assemblies (example from my case below):
As you can see, they are all empty and have no extension - all of those were in root directory and there was one file for each .csproj. I have no idea where they came from, I did not create them, I had them in my repository since the very first commit.
Removing all those empty files fixed the problem.
To figure this out I had to re-make the entire project and copy every asset one-by-one and seeing if it still compiles and then (once all assets were copied) I did a git diff to see what was different between those two projects. It was a very tedious job to do.