Runs in editor but then referencing errors on build

Hi there,

Kind of weird, but I feel like the solution will be easy enough. I had a project that I could build both to android and iOS. Everything worked. Then I cleaned up my filesystem a bit, and I RENAMED the Unity project directory name (from MobileVR_iOS to MobileVR).

After this I reloaded the Unity project and it runs within the editor, but when I try to build I get a series of “error CS0234” saying “UI”, and “EventSystems” aren’t found in UnityEngine namespace. It seems like when I renamed the project, the monodevelop project no longer matches, or lost references. I’m on OSX if it makes any difference…

Does anyone know where I would fix this?

Thanks!!

Try doing a reimport-all of your project. Sounds like the UI dll has not been imported correctly.

Thank you, I didn’t get a chance to try this. Instead, I tried switching platforms, and then I lost references to a bunch of my components (namely the Image components attached to Canvas). So I found a forum that said to delete the “Temp”, “Library”, and “Project Files” directories. A little outdated, but I closed my project and deleted the Library directory only (Temp was gone because I wasn’t open in unity), then reopened my project and EVERYTHING was fixed! :slight_smile:

So this did manage to fix the build time compile issues.

Thanks!

Yeah that’s the same as doing a reimport all :wink:

1 Like