Search Unity

(Case 1142289) TextMesh Pro: Feature `out variable declaration' cannot be used

Discussion in '2019.1 Beta' started by Peter77, Mar 31, 2019.

  1. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,899
    EDIT: Here is the link to the solution:
    https://forum.unity.com/threads/cas...claration-cannot-be-used.653566/#post-4435042


    I opened my 2019.1.0b4 project in Unity 2019.1.0b9 and TextMesh Pro was throwing the following errors:
    Code (CSharp):
    1. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/FastAction.cs(24,45): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    2. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/FastAction.cs(59,45): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    3. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/FastAction.cs(94,45): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    4. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/FastAction.cs(129,45): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    5. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/MaterialReferenceManager.cs(585,74): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    6. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/MaterialReferenceManager.cs(621,74): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    7. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(408,82): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    8. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(408,99): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    9. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(638,69): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    10. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(771,60): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    11. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(986,51): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    12. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(1081,238): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    13. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(1098,83): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    14. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(1131,53): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    15. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(1222,238): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    16. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(1241,83): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    17. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(1306,209): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    18. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(1458,209): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    19. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(1876,82): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    20. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs(1880,83): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    21. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_InputField.cs(1561,148): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    22. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_InputField.cs(1607,139): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    23. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_InputField.cs(1682,152): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    24. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_MaterialManager.cs(368,58): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    25. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_MaterialManager.cs(428,68): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    26. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_MaterialManager.cs(430,62): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    27. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_MaterialManager.cs(450,68): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    28. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_MaterialManager.cs(452,62): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    29. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_MaterialManager.cs(501,70): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    30. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_MaterialManager.cs(503,62): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    31. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_SpriteAnimator.cs(48,65): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    32. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_SpriteAsset.cs(170,68): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    33. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_SpriteAsset.cs(188,56): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    34. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_SpriteAsset.cs(205,58): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    35. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_StyleSheet.cs(72,61): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    36. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(1948,75): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    37. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2060,75): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    38. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2170,75): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    39. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2252,75): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    40. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2417,75): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    41. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2561,75): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    42. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2633,80): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    43. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2703,80): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    44. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2773,80): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    45. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2843,80): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    46. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2911,80): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    47. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(2979,80): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    48. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(3047,80): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    49. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(3114,80): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    50. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(3812,73): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    51. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(3945,130): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    52. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(3958,130): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    53. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(5446,177): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    54. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(5446,214): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    55. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(5458,179): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    56. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(5458,216): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    57. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs(5919,66): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    58. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_TextUtilities.cs(2039,100): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    59. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMPro_Private.cs(1019,59): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    60. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMPro_Private.cs(1751,73): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    61. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMPro_Private.cs(1903,130): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    62. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMPro_Private.cs(1916,130): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    63. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMPro_UGUI_Private.cs(1089,59): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    64. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMPro_UGUI_Private.cs(1865,73): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    65. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMPro_UGUI_Private.cs(2028,130): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    66. Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMPro_UGUI_Private.cs(2041,130): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification
    67.  

    screenshot.png

    Lucky for me, I don't use TextMesh Pro in this project, so I was able to simply remove the package and the error vanished.
     
    Last edited: Jul 26, 2019
    bowde03 likes this.
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,110
    I've had some issues with TMP not handling updates very well - it seems like it's not getting recompiled properly after upgrading the Unity version. Deleting it's folder in Library/PackageCache has fixed the issue. Just selecting it and reimporting hasn't.
     
  3. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,899
    I tried that, didn't fix the issue here.
     
  4. mitsuoverstreet

    mitsuoverstreet

    Joined:
    Nov 13, 2017
    Posts:
    2
    Same issue, Did you figure anything out?
     
  5. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,899
    Nope. QA replied with "Change Scripting Runtime Version to .NET 4.x" and closed the issue. Not sure if that's the proper solution though, since this issue did not exist in 2019.1.0b4. Something did change between b4 and b9 which now causes this issue.

    However, I did what I could do to make Unity aware that there seems to be an issue. If they believe the solution is to switch to .NET 4.x, then fine ¯\_(ツ)_/¯
     
    Last edited: Apr 16, 2019
    evyviggy, bowde03, m4c22 and 2 others like this.
  6. fstim82

    fstim82

    Joined:
    May 4, 2010
    Posts:
    28
    How does one "Change ScriptingBackend to .NET 4.x"?
     
    evyviggy and bowde03 like this.
  7. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,899
    Last edited: May 11, 2019
  8. pierre-olivier_unity

    pierre-olivier_unity

    Joined:
    Apr 12, 2019
    Posts:
    7
    This solved the issue for me :) Thank you !
     
    tigerss, m4c22 and Peter77 like this.
  9. MarcusTheMainMan

    MarcusTheMainMan

    Joined:
    Nov 29, 2012
    Posts:
    196
    Edit > Project Settings > Player > Other Settings > Scripting Runtime Version

    that fixed it for me in 2019.1 full release. It was set to 3.5(depreciated). You'd think with just 2 settings (and 1 of them not being good), unity would have just changed it for you. Oh well.
     
    Ceejay710 and msf-eng92 like this.
  10. XianGrim

    XianGrim

    Joined:
    Jan 14, 2014
    Posts:
    2
    Can confirm, Peter77's solution worked for me too
     
    bowde03 likes this.
  11. S3490713

    S3490713

    Joined:
    Apr 27, 2019
    Posts:
    1
    I upgraded from the 2017 version to the 2019 release, can also confirm that Peter77's solution worked for me too.
    Thanks for also posting how to change the Scripting Runtime Version :)
     
    bowde03 likes this.
  12. bowde03

    bowde03

    Joined:
    Sep 17, 2018
    Posts:
    1
    This was an issue for me too, and about had me going crazy, until I found this thread, so just wanted to say this worked for me too. Changed to 4.x and all 72 errors went away and the project runs just fine!
     
    Peter77 likes this.
  13. George-Dolbier

    George-Dolbier

    Joined:
    Sep 1, 2013
    Posts:
    9
    Confirmed again, just migrated a project from Unity2017 and TMPro 1.x to 2019.1 and TMPro version. all compile error messages gone, have a ton of null pointer reference exceptions, but that may be due to editor values not being carried over
     
  14. TheKingOfTheRoad

    TheKingOfTheRoad

    Joined:
    Apr 24, 2013
    Posts:
    56
    You sir, saved my life.
     
  15. torchatlas

    torchatlas

    Joined:
    Mar 3, 2019
    Posts:
    1
    Thanks SO much Peter77! I'm been trying to figure out how to fix this for the longest time — the solution ended up being incredibly simple!
     
    Peter77 likes this.
  16. tlskillman

    tlskillman

    Joined:
    Dec 12, 2015
    Posts:
    6
    Switching to .NET 4.x fixes the TextMesh Pro error, but induces errors in other packages I'm using. I wish there was a solution that doesn't require upgrading to .NET 4.x. For now, I have to regularly go back into the
    Library/PackageCache/ and delete com.unity.textmeshpro@2.0.0 to get my code working again...
     
  17. Ceejay710

    Ceejay710

    Joined:
    Jan 13, 2018
    Posts:
    1
    It works for me as well. In the package manager, TextMeshPro requires .NET 4.x now. Thanks, dude!