Text Mesh Pro type or namespace issue

I’ve been doing a lot of googling which says that you need to remove TextMeshPro and reimport it from the Package Manager. I’ve gone ahead and done this multiple times with no success.

I’m currently using TextMeshPro version 2.0.1, and on Unity version 2019.2.17f1.

I get the following errors in my console on Unity:
Assets\Scripts\UI\SelectedUnitDisplay.cs(1,7): error CS0246: The type or namespace name ‘TMPro’ could not be found (are you missing a using directive or an assembly reference?)
Assets\Scripts\UI\SelectedUnitDisplay.cs(6,12): error CS0246: The type or namespace name ‘TextMeshProUGUI’ could not be found (are you missing a using directive or an assembly reference?)

If I open up Visual Studio I see the same error inside of there, however if I hit alt + enter and click “Add reference to Unity.TextMeshPro.dll” the errors inside of Visual Studio will go away. They will not go away from the console in Unity, and Unity will not allow me to play my scene as it says I need to fix the compile errors.

Any ideas? I’m still digging through things online but there doesn’t seem to be a whole lot of information. Thanks!
Snackmix

Nevermind I found the issue! I had created an AssmeblyDefinition for my scripts so that I could write unit tests. I needed to go add the reference to Unity.TextMeshPro, and Unity.TextMeshPro.Editor to my Assembly Definition References. This seems to have fixed my issues!

3 Likes

Hi, thanks for providing that anwer! I’ve had the same issue and since I’m new to testing I would probably waste a lot of time trying to find that solution :slight_smile:

1 Like

I have the same problem, the same fix worked. The thing that bugs me though, is that why this is so? All other libs work just fine and just the TMP breaks like this. Very confusing and frustrating.