- Home /
Can't use namespace 'TMPro' with the TextMeshPro Package (2018.2.0f2)
Hello, I'm having a problem with the Text Mesh Pro package.
Whenever I try to use the namespace 'TMPro' in Unity 2018.2.0f2, it says that the namespace doesn't exist. And when I try to open the TextMeshProUGUI.cs in the solution explorer, it says that the file doesn't exist neither.
However if it did compile in a previous version (2018.1.0f2) and it works fine, but I can't modify the script in my current version. Could this be a bug?
Namespace Error: Solution Explorer:
It sounds like all your Text$$anonymous$$eshPro files are in the Assets folder. Delete them and import the Text$$anonymous$$eshPro package via Package $$anonymous$$anager (Window -> Package $$anonymous$$anager). This should solve your issue.
I'm actually using the T$$anonymous$$Pro package. I tried to create a new empty project and I have the exact same problem, I'll add a image on the question maybe that'll help.
Answer by TomiWolf · Jul 16, 2018 at 05:18 PM
Ok here's a temporary solution (Maybe it's not the best solution):
In the editor, in the folder explorer go to Packages>TextMesh Pro, right-click the TMP folder and select show explorer, copy the folder direction or just go to C:\Users\ Your User \AppData\Local\Unity\cache\packages\packages.unity.com. You'll find all the unity packages, in this case com.unity.textmeshpro@1.2.4.
And follow one of these steps (I'm not sure which one is the best):
a. Copy the scripts you need, in my case, TextMeshProUGUI.cs and paste them in Your Project Folder \Packages in the corresponding subfolder of the script, and now the visual studio solution should be able to find that .cs file.
b. In visual studio in the solution explorer (Usually in the right part of the screen) find the folder Unity.TextMeshPro>Packages>com.unity.textmeshpro>Scripts>Runtime and right-click and add an existing item, and add the script you need.
Apparently, that happens because in this Unity version, the Package Manager tries to copy and Paste the packages to a local project folder, but for some reason, they are empty and visual studio expects to be there all the package files in there. I still don't know if that's a problem in this unity version or something is wrong in my PC.
Better solution: Just update Visual Studio with the Visual Studio Installer
Here's a definitive solution: Update Visual Studio with the Visual Studio Installer program, now everything works fine!
Does not work. I have updated Visual Studio (Community 2017) but the error remains. Actually now the error has changed. ![alt text][1] The namespace is found now (after the VS update), but not the classes.
I had to manually copy all package files. But I do not feel very safe. I hope I have more problems with this move. [1]: /storage/temp/121291-screenshot-1.png
Answer by Valthec · May 12, 2020 at 12:20 PM
Check if you are using Assembly Definition file for your scripts. If so, then open your .asmdef file with the inspector and make sure that Unity.TextMeshPro is on the Assembly Definition References list. It is not added automatically when you import TextMeshPro assets.
This one did it for me, I was trying to use T$$anonymous$$Pro in a self-written package. Thank you.
Saved me a lot of time after a lot of headache, this should be the top comment
Answer by NIHAALKNIGHT87 · Dec 16, 2018 at 05:20 PM
Just Download the Text mesh Pro From the Assert Store, To solve this Problem ("TMpro")
if U already have that then Delete entire folder of Text mesh Pro and Try it to Reimport the TMPro
This worked for me. I had upgraded from VS 17 to 19. Needed to download T$$anonymous$$Pro again.
Removing whole Text mesh Pro and reinstalling actually worked. Thanks for the help!
Answer by Sercova · Aug 12, 2018 at 09:25 PM
Here is the answer to all your problems with TextMesh Pro and unity 2018.2: https://forum.unity.com/threads/textmesh-pro-unity-2018-1.511748/
I had to realize, but here is explained.
Answer by jacksonkr · Apr 25, 2019 at 06:09 PM
TextMesh Pro was added to unity as of 2018.2
I was working on an old project when I saw this conflict so I had to remove tmp from our assets and upgrade the scripting library to .net 4.0 (from 3.5)
I had also upgrade visual studio two have the unity development package via Visual Studio Installer > modify
Your answer
Follow this Question
Related Questions
New Update Text Issue 0 Answers
How to fix TextMeshPro breaking lines and escaping random characters? 0 Answers
server to unity news update and visa versa 1 Answer
Text Not updating 1 Answer
Realtime clock 3 Answers