OneDrive broke my Unity Project

While I was working on my project yesterday, I was suggested to use the school OneDrive so that I could access my project from any computer, but when I loaded it up on my main computer, it gave me a bunch of errors yesterday, but now only 3:

Failed to resolve packages: An error
occurred while reading the file
[C:\Users\Ja.----20\OneDrive
----------- ------ -------- --. –\Documents\Unity\Battle System Terradaro
Ideas\Packages\manifest.json]:
UNKNOWN: unknown error, read. No
packages loaded.
A re-import of the project may be required to fix the issue or
a manual modification of
C:\Users\Ja.----20\OneDrive
----------- ------ -------- --. –\Documents\Unity\Battle System Terradaro
Ideas\Packages\manifest.json file.

Assets/Scripts/LoadNewArea.cs(21,35): error CS1070: The type ‘UnityEngine.Collider2D’ has been forwarded to an assembly that is not referenced. Enable the built in package ‘Physics 2D’ in the Package Manager window to fix this error.

Assets/Scripts/MusicController.cs(8,12): error CS1070: The type ‘UnityEngine.AudioSource’ has been forwarded to an assembly that is not referenced. Enable the built in package ‘Audio’ in the Package Manager window to fix this error.

What can I do to fix these errors?

It was a simple fix, as it turns out. If this has happened to you, the solution is super easy, just create a new project the exact same way as the last one, and copy the manifest from the new one onto the old one. A.K.A. if you created a 2D project, create a new 2D project and copy that manifest.

LEARN FROM MY SUFFERING AND NEVER PUT IT IN ONEDRIVE.

i have the same issue but i fixed it by opening the project before onedrive starts syncing it

DO NOT USE CLOUD STORAGE SYNC!

At least not for the whole project. You can zip the project and move the zip to the cloud drive, then unpack on another machine.

The problem with cloud sync - no matter which cloud storage provider - is that Unity projects are not designed to work with these, and as a result they can cause project corruption beyond repair!

Here’s the problems with cloud synch of a Unity project:

  • It syncs the Library folder - aka waayyyy too much, way too often
  • It’s not guaranteed (not easy to see) that the latest version has completely uploaded
  • Same issue with downloads, you may be opening the project before it has fully synched all files
  • There is no conflict resolution - the file that was uploaded last from any machine will override any existing file. Particularly problematic if you ever have the project open on two or more machines simultaneously.

Use source control! (ie GitHub)