Hello everyone, yesterday I was checking old projects. I opened a recent one (last working version, actually published in Google Play and properly backed up a couple of months ago) with the exact same Unity version I used back then to compile it (2019.3.12f1).
Out of the blue, two errors that I never (ever) see before jumped out: using TMPro and using UnityEngine.UI got an error in VS Community 2019 (The type or namespace name ‘TextMeshProUGUI’ could not be found) and obviouslly, all the images, buttons and textMeshPro references in every script gave an error.
Already try to uninstall and reinstall VS, and to open the Unity project with a newer version (same issue, plus a complaint about duplicate JSON instances, which I didn´t get in the original Unity version).
After a couple of days looking for a solution online, I think is time to ask if anybody had been through this before, and hopefully, a solution to try…
Thank you very much to all of you, have a great day!
TextMeshPro isn’t something that comes with base Unity, it’s something you get from the Package Manager. Have you tried re-installing it? Just my two cents. That wouldn’t explain why UnityEngine.UI would be throwing an error though.
That’s also a package. So accidentally removing it would cause similar problems.
Plus one thing causes similar symptoms if you create unwanted/misconfigured assembly definition file. All of these should be added as references when you make an assembly definition file. I know it’s unlikely, but possible.
Thanks, RadRedPanda! Unfortunatelly, I did try to reinstall it, without any success! And you´re right about UnityEngine.UI, because in the Package Manager, it says TMPro depends on UnityEngine.UI… the weird thing is that other than the error alert on VS, the project keeps running fine…
Thank you very much for your answer, Lurking-Ninja! I don´t believe I did something with an assembly definition file (at least I don´t think so…). All this problems started when I upgrade the Unity version I used to edit the project. Immediattely after that I replace the now-corrupted Unity project with a fresh backed up one, but I must broke something else, because even then it keeps throwing me that error. The only different thing is that if I open the project with Unity 2020.XX, VS gives me the option to delete unused “using” references, and then it allows me to add them again (without any errors after that). But I don´t want to switch to a newer compiler, I just want to keep using the 2019 one (which besides, it happens to be the original…)
The package manager cache might be borked… close Unity and browse to your project. Next to Assets and ProjectSettings folder is a Library folder… dig in there for something that looks like “package cache” (I forget the name) and nuke it, then reopen Unity and it will haul all the packages down afresh.