Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

The type or namespace name 'TextMeshProUGUI' could not be found

Discussion in 'Package Manager' started by magg, Aug 6, 2018.

  1. magg

    magg

    Joined:
    Sep 29, 2013
    Posts:
    63
    So after going from 2017.3.1 to 2018.2.1f1 I had to spend 2 days fixing stuff - mostly just related to TMP. Everything was broken so I had to uninstall (delete), install, reinstall and manually fix all my TMP UIs.

    The game is running without any problems now (even builds), but for some odd reason Visual Studio gives me these:
    The type or namespace name 'TextMeshProUGUI' could not be found (are you missing a using directive or an assembly reference?)

    It's everywhere I'm using it like this:
    public TextMeshProUGUI UI_EntryTxtLocation;

    Also VS now says "Using directive is unnecessary" for:
    using TMPro;
    using UnityEngine.Events;
    using UnityEngine.EventSystems;

    Any ideas?
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,305
    Sorry that you had to invest that time to upgrade to the newer version of TMP. Provided you followed the procedure outlined in the following sticky post as well as reviewed the Update Notes at the bottom of this post, the process should have been pretty quick (with the exception of the scanning process which can take more time depending on the project size).

    In terms of the errors in Visual Studio, this is an issue between Assembly Definitions (which packages happen to use) and Visual Studio / VSTU. The solution is to upgrade to the latest version of Visual Studio 2017 which is 15.7.6. This information is also provided in the Update Notes section of the post I referenced above.

    Let me know if this resolves your issue?
     
  3. magg

    magg

    Joined:
    Sep 29, 2013
    Posts:
    63
    Thanks - that was FAST.

    Reinstalled VS and everything looks a-OK. TY again.
     
    Stephan_B likes this.
  4. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    664
    Getting this now in VS 15.8.7
    upload_2018-10-23_20-11-45.png

     
  5. hal0000

    hal0000

    Joined:
    Oct 5, 2017
    Posts:
    7
    @Stephan_B yea samething happened to me please check my post.
     
    Yashajain likes this.
  6. Alkanov

    Alkanov

    Joined:
    May 15, 2017
    Posts:
    46
    Same problem here - Unity works fine and no errors found but on the VS project I get the same errors as above screenshot
     
  7. Alkanov

    Alkanov

    Joined:
    May 15, 2017
    Posts:
    46
    Changing the editor from VS to extension and then back to VS solved the problem
     
  8. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,305
    Glad to know this worked.

    I'll bring this thread again to the attention of the appropriate folks at Unity as whatever is causing this behavior should be addressed.
     
  9. LeleUnity

    LeleUnity

    Joined:
    Jul 30, 2016
    Posts:
    26
    Hello, I Have 2018.3.7.f1,
    and Both TextMeshPro and Packages Manager do not show in Window. I had a working project in Unity 2017
    LTS, I then updated to this and I have this problem.
    I tried:
    -Help-->Reset Dependencies.
    -deleting cache
    -deleted old TextMeshPro from Asset
    this is the manifest:
    "dependencies": {
    "com.unity.ads": "2.0.8",
    "com.unity.analytics": "3.2.2",
    "com.unity.collab-proxy": "1.2.15",
    "com.unity.package-manager-ui": "2.0.3",
    "com.unity.purchasing": "2.0.3",
    "com.unity.textmeshpro": "1.3.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
    }
    }
    PLEASE HELP ME IT'S 5 DAYS I AM Struggling with this !
     
  10. LeleUnity

    LeleUnity

    Joined:
    Jul 30, 2016
    Posts:
    26
    I have done also what you suggested in here. nothing works!
     
  11. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,305
    Have you tried both updating Visual Studio to the latest release and changing the External Script Editor?

    If the issue persists, please submit a bug report with the project so that we can have our scripting folks take a look at this so we can resolve this issue once and for all.
     
    LeleUnity likes this.
  12. LeleUnity

    LeleUnity

    Joined:
    Jul 30, 2016
    Posts:
    26
    Yes Ihave done that. No solution.
    How Can I upload a very sensitive project of many gigabytes?
     
  13. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,305
    Just use the Help - Report a Bug.

    The includes resources in the report are private and will only be used to resolve the reported issue.
     
  14. hpr895

    hpr895

    Joined:
    Apr 30, 2019
    Posts:
    1
    Hi )

    Try to use this:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. using TMPro; // <= THIS
    7.  
    8. public class Score : MonoBehaviour
    9. {
    10.     public Transform player;
    11.     public TextMeshProUGUI scoreText;
    12.  
    13.     void Update()
    14.     {
    15.         float position = player.position.z;
    16.  
    17.         scoreText.text = position.ToString();
    18.     }
    19. }
    20.  
    You can find it by clicking on the Text Mesh Pro UGUI with right mouse button, then "Edit script", then just copy class namespace in using section of your class.
     
    Last edited: May 21, 2019