Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

TextMesh Pro Text Mesh Pro Dozens of errors with Unity 2019.1

Discussion in 'UGUI & TextMesh Pro' started by MikeUpchat, Apr 16, 2019.

  1. Zyrathius

    Zyrathius

    Joined:
    Dec 18, 2012
    Posts:
    20
    I just recently experienced this issue as well and switching my project to .NET 4.x helped, however because I did have Bolt installed, I also had to reinstall Bolt making sure to switch it's install to the .NET 4 as well before the error would subside, even though there was no mention of Bolt in the error messages.
     
  2. ff63gf

    ff63gf

    Joined:
    Nov 15, 2019
    Posts:
    1
    There is no "Scripting Runtime version" at 2019.2.12f1. But I solved this problem with change "Edit > Project Settings > Player > Other Settings > Api compatibility Level" to .NET 4.x.
     
    Harinezumi likes this.
  3. Ella_Jay

    Ella_Jay

    Joined:
    Dec 5, 2018
    Posts:
    1
    Thank you! this worked for me
     
  4. eduardo1087barreto

    eduardo1087barreto

    Joined:
    Feb 13, 2020
    Posts:
    1
    I'm having the same problem can someone help me ?????
     

    Attached Files:

  5. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,793
    Please update to version 2.1.0-preview.4 of the TMP Package for Unity 2019.x.
     
  6. Mestroyer12

    Mestroyer12

    Joined:
    Aug 7, 2018
    Posts:
    2
    THANK YOU, THANK YOU, THANK YOU, THANK YOU SO MUCH
     
    Harinezumi likes this.
  7. bhison

    bhison

    Joined:
    Feb 9, 2015
    Posts:
    8
    For the record, the only thing that worked for me was deleting AppData. Very frustrating bug!
     
    Harinezumi likes this.
  8. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,793
    What specific issue did you run into?

    This initial issue was related to the .Net 4.x changes that resulted in these errors when the project was still set to .Net 3.5. Overtime, we uncovered other issues related to Assembly Definitions, Package Manager, etc... Just trying to get more insight from you in case this is something new or the same issue.
     
  9. Harinezumi

    Harinezumi

    Joined:
    Jan 7, 2013
    Posts:
    54
    Just updated a project from 2019.2 to 2019.4, it was already .Net 4.x, and I removed the TextMeshPro packages both from AppData and Library folder. Still get the error about Task being defined both in TMP_Pro and mscorlib.

    Any suggestion what else could I try?

    (It is VERY frustrating that there is no actual solution, the problem is not caused by anything I did, and it completely blocks working on a project)
     
    Last edited: Jun 14, 2020
  10. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,793
    See the following post and others in this thread for potential solutions.
     
  11. Harinezumi

    Harinezumi

    Joined:
    Jan 7, 2013
    Posts:
    54
    Yeeeeah, no. Have your read my post? I said I tried the approaches from this thread: the project was already .Net 4.x, and the package cache has been removed from both AppData and Library folders before opening the project again. And no, I do not use Bolt.

    I understand that you might be overloaded and even took the time to respond on a Sunday, but still a bit more understanding and not just pointing to the same forum thread would be nice.
     
  12. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,793
    Most likely some plugin is causing this behavior.

    See if the following helps https://stackoverflow.com/questions...got-error-the-type-taskt-exists-in-both-unity

    the above is from https://answers.unity.com/questions/1637260/the-type-task-exist-in-both-unitytasks-and-mscorel.html
     
  13. Vivien_Lynn

    Vivien_Lynn

    Joined:
    May 17, 2019
    Posts:
    16
    I solved it and it was my mistake:

    What I did wrong: I went to the Package Manager and by default it selects "My Assets" instead of "Unity Registry" from the dropdown menu in the top left. That means I accidentally installed TMP 1.2.2, because that's the version I own from the times before TMP became part of Unity.
    We of course want to install Version 2.1.3 or later.
    So I removed the old version, reinstalled the new version, done.
     
  14. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    200
    I'm still getting these errors despite doing the following:

    • Changed to .NET 4
    • Updated TMPro from Package Manager
    • Deleted PackageCache and Library Folders
    • Restarted Unity
    Library\PackageCache\com.unity.textmeshpro@2.1.3\Scripts\Runtime\TMP_Text.cs(8561,96): error CS1061: 'FaceInfo' does not contain a definition for 'pointSize' and no accessible extension method 'pointSize' accepting a first argument of type 'FaceInfo' could be found (are you missing a using directive or an assembly reference?)
     
  15. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,793
    What version of Unity are you using?
     
  16. SanSan13ss

    SanSan13ss

    Joined:
    Aug 29, 2019
    Posts:
    6
    Hello. There are problems with the work of <sprite name = name>. Using names like PM and O2. I looked at the code and probably found a bug. When generating the valueHashCode. You are using an algorithm that does not provide unique values.

    TMP_Text, Line 6947 and 7013
    valueHashCode = (m_xmlAttribute[attributeIndex].valueHashCode << 5) + m_xmlAttribute[attributeIndex].valueHashCode ^ unicode;

    For example:

    PM - (p = 80, M = 77)
    1. (0 << 5) + 0 ^ 80 = 80
    2. (80 << 5) + 80 ^ 77 = 2589
    (80<<5) = 2560
    2560 + 80 = 2640
    2640 ^ 77 = 2589
    valueHashCode = 2589

    O2 - (o = 79, 2 = 50)
    1. (0 << 5) + 0 ^ 79 = 79
    2. (79 << 5) + 79 ^ 50 = 2589
    (79 << 5) = 2528
    2528 + 79 = 2607
    (2607 ^ 50) = 2589
    valueHashCode = 2589

    Maybe you should adjust the algorithm ()
    valueHashCode = (m_xmlAttribute[attributeIndex].valueHashCode << 5) + (m_xmlAttribute[attributeIndex].valueHashCode ^ unicode);
     
  17. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,793
    I'll take a look.

    Until then and since the risk of collisions is higher with shorter values, I would suggest using a few more letter in there :)
     
  18. SanSan13ss

    SanSan13ss

    Joined:
    Aug 29, 2019
    Posts:
    6
    Hello. Unfortunately, we cannot use other names for the sprites. I think the problem is in the algorithm because of the priority of the operations (1 - +, 2 - ^). I need to figure out where in the code I can tweak the algorithm to make the sprites work correctly. Could you please indicate where the valueHashCode is generated. (As TMP_Text, Line 6947 and 7013) TMP version - 1.4.1

    Possible fix
    valueHashCode = (m_xmlAttribute [attributeIndex] .valueHashCode << 5) + (m_xmlAttribute [attributeIndex] .valueHashCode ^ unicode);
     
  19. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,793
    Changing this algorithm will require changes not only in the parser in the TMP_Text.cs file but in every other place where a hashcode is used to match a parsing value with anything else like a sprite name, font asset name, material, style, etc.

    I will revise the hash function in the next preview release.

    Modifying the current algorithm as follows would reduce the potential collisions.
    Code (csharp):
    1.  
    2. public static int GetHashCodeCaseInSensitive(string s)
    3. {
    4.     int hashCode = 5381;
    5.  
    6.     for (int i = 0; i < s.Length; i++)
    7.         hashCode = (hashCode << 5) + hashCode ^ s[i];
    8.  
    9.     return hashCode;
    10. }
    11.  
    The change is to change the seed from 0 to 5381.
     
  20. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    369
    I fixed the problem by

    1. Remove TMP in the Package Manager
    2. Remove TMP folder from the Package
    3. I deleted any TMP folder in the Projects Folder directory
    4. Deleted the TMP.json file
    5. Restarted Unity

    7. Start a new empty scene

    6. In PackageManager I re-imported TMP

    Now looks to be OK.
     
  21. Sutee9

    Sutee9

    Joined:
    Mar 12, 2015
    Posts:
    5
    OMG, THANK YOU! You literally just saved me HOURS of work. Amazing that this tool exists, amazing that you made this post that pops up so highly ranked in Google.
     
unityunity