Search Unity

Question Messed up existing project with MARS

Discussion in 'Unity MARS' started by gwhitcher_unity, Jan 23, 2021.

  1. gwhitcher_unity

    gwhitcher_unity

    Joined:
    Jan 15, 2018
    Posts:
    45
    Hi all. I had an AR project I was working on that was using the AR+GPS Asset. I decided to look at what MARS could bring and I loaded it into that project. It completely broke the project. I tried to recreate the project from scratch, but now, I can compile it once and everything compiles without a problem. The second compile creates these types of errors. (43 of them)

    Metadata file '......Temp\bin\Debug\UnityEngine.TestRunner.dll' could not be found Unity.InternalAPIEditorBridge.005

    Projects.png
     
    Last edited: Jan 23, 2021
  2. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    Hi there! Sorry that you're having trouble. To be clear, you have removed MARS from the project and you are still seeing compile errors? Are you able to report a bug and attach the project in this error state so that we can take a look?

    I haven't encountered what you are seeing here, but if you have removed MARS and the problems persist, can you try deleting the Library folder and all `.sln` and `.csproj` files while Unity is closed, and then try opening the project again? MARS also creates a folder in assets called MARS which contains some generated code which should also be deleted.

    What you're seeing in your IDE is likely caused by a workaround related to how Unity handles AssemblyReference files. Essentially, we need your IDE to show all package projects in order for it to be aware of MARS code, so that you can write code using the MARS API. There's more information about potential issues in in this thread.

    This setting is an EditorPref, which unfortunately means it affects all Unity projects on your system. You can clear it out by going to Preferences > External Tools. Depending on what Unity version you are in, you may see a few different presentations of this option. For older versions, you might see an option called "Generate all csproj files", which is probably now checked, or a slightly more complicated UI with multiple checkboxes, and "Generate .csproj files for... > Registry Packages" is probably checked. We set this preference automatically on import so that you don't see errors when you try to write scripts with MARS in the project. In either case, if you uncheck that option, and regenerate your IDE project files, you should get back to the default environment where you only see project files generated only for `Assembly-CSharp` and assemblies in Assets.
     
  3. gwhitcher_unity

    gwhitcher_unity

    Joined:
    Jan 15, 2018
    Posts:
    45
    Thank you so much. I pretty much thought I destroyed my app and didn't know how to recover. This did the trick!
     
    mtschoen likes this.