I had the same error when I updated unity from version 2018.3.11f1 to 2019.1.0f2 and I tried all the fixed I could find on the internet, what SOLVED it is just by deleting “Drive:\UnityProjects\Project_Name\Packages\manifest.json” file and restarting unity.
Try Reimporting assets from “Unity:-Assets->ReimportAll” see if it works for you.
Hey this thread is a little old, but what solved this for me is when I “upgraded” my unity and opened my old project, Unity put some of the old unity engine tools in a folder inside my asset folder. It was named 2d-extras-2018.3. I deleted this folder, then some assets auto imported, then my build errors were fixed
I was trying to complete Junior Pathway Programmer and it required version 2018.4, but I tried it on 2019.4 and it gave me the CS0246 errors. This solution worked for me very well! Thank you @karl_jones