Search Unity

Bug TMPro namespace not recognized after creating main assembly definition.

Discussion in 'UGUI & TextMesh Pro' started by sunnythe2nd, Apr 4, 2023.

  1. sunnythe2nd

    sunnythe2nd

    Joined:
    Mar 26, 2023
    Posts:
    4
    So, normally TextMeshPro works just fine in my Unity projects. However, when building an assembly for unit tests, the moment I create the main assembly definition in the scripts folder, suddenly my code stops recognizing the TMPro namespace. I've tried adding the references to the TMPro assembly definitions to the assembly to see if that would solve the problem, but nothing I'm doing seems to be working. If anyone else has encountered this problem in the past and figured out a way to solve it, I would really appreciate a solution.
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,487
    TMPro isn't a 2D thing, it's a UI thing.

    I'll move your post to the TMPro/UI forum for you.
     
    sunnythe2nd likes this.
  3. sunnythe2nd

    sunnythe2nd

    Joined:
    Mar 26, 2023
    Posts:
    4
    Does nobody know how to solve this? It's really hindering my project's development since I'm unable to write unit tests while this problem persists.
     
  4. sunnythe2nd

    sunnythe2nd

    Joined:
    Mar 26, 2023
    Posts:
    4
    Bumping this again on the off chance someone could help me with this problem.
     
  5. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,087
    Have never used Addressables with TMP, largely because TMP relies on some of the old Resources folder trickery.

    Is there any way you can live without putting the TMP parts of your project into Addressables?
     
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,336
    Adding a reference to the TMP assembly is what you have to do;

    upload_2023-4-12_14-12-10.png

    Have you done that, hit Apply, and still get problems?
     
  7. sunnythe2nd

    sunnythe2nd

    Joined:
    Mar 26, 2023
    Posts:
    4
    Yes, as I said I added the references and my scripts still do not recognize the namespace.
     
  8. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,336
    What do you mean here by "not recognize"?

    Do you get compiler errors in Unity, or in your code editor?
     
  9. GhastyBoy

    GhastyBoy

    Joined:
    Nov 14, 2022
    Posts:
    1
    Since I have the exact same problem I'm gonna reply in hope that somebody can help.
    Even if I added the references, all of my scripts stops recognising TMPro, I get an error in my code editor AND in Unity, at the line
    Code (CSharp):
    1. using TMPro;
    as well as everywhere I try to access a component "TMP_Text".
    I just added this Assembly thing, I have no idea of what it does I just know I need it to test some of my scripts.

    Hope that somebody can help me
     
    Tyrann0s likes this.