Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

hopefully a daft newbie question

Discussion in 'Getting Started' started by andrewcrosse, May 27, 2019.

  1. andrewcrosse

    andrewcrosse

    Joined:
    May 27, 2019
    Posts:
    1
    hi

    I have started using unity recently, I have an error code as follows.

    Library\PackageCache\com.unity.textmeshpro@2.0.1\Scripts\Editor\TMP_PackageUtilities.cs(310,17): error CS0433: The type 'Task' exists in both 'Unity.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c....

    I have the latest version of textmesh, but cant see mscorlib
    I have tried rolling back the textmesh release, this does not do the job.
    im on unity 2019 3.oa3 and 5.6.5p4

    thanks for any help
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,952
    Be wary of downloading releases that have an "a" or "b". The "a" means that the release is an alpha that has new but very buggy functionality. Alpha releases are intended for experienced Unity developers that are comfortable dealing with the problems that are practically guaranteed to be there.

    The "b" means that the release is a beta that has gone through alpha and has been deemed stable enough that it's no longer going to have major stability problems, but it's still a bugged release that is intended for experienced developers.

    For new developers I recommend downloading "f" releases. These are releases that have gone through both the alpha and beta stages of testing and are deemed stable enough for production use. You generally won't have problems like this one if you stick with them.
     
    Joe-Censored likes this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The Package Manager didn't exist in Unity 5.x, so you can't use the TextMesh Pro package in that version. You'd have to use the asset store version.

    As already mentioned you should not be using early alpha versions of Unity as a newbie. Those are just for experimentation, to give Unity feedback, and are not intended for serious use. 2019.3 is probably 6 months away from being stable enough for an official release. You will run into serious feature breaking problems in alpha versions.

    Try the latest version of 2019.1.x if you like latest/greatest, or 2018.4.x LTS for stability.
     
    Ryiah likes this.
  4. pavisfel

    pavisfel

    Joined:
    Jan 9, 2018
    Posts:
    1
    yep - I got the same in 2019.2.0f1:
    Library\PackageCache\com.unity.textmeshpro@2.0.1\Scripts\Editor\TMP_PackageUtilities.cs(310,17): error CS0433: The type 'Task' exists in both 'System.Threading, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Try Reset Packages to Default under the Help menu.
     
  6. rehman_ilyas

    rehman_ilyas

    Joined:
    Dec 10, 2015
    Posts:
    1
    I got same error and Reset Packages to Default did nothing. I am using version 2019.2.0f1
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you are not using the package, you can always remove it.
     
  8. natmaxex

    natmaxex

    Joined:
    Jul 12, 2012
    Posts:
    68
    I'm using it!!!
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The latest one?
     
  10. Lighthammer34

    Lighthammer34

    Joined:
    Feb 5, 2017
    Posts:
    2
    I also get the same in all versions from 2018.3 upwards - Library\PackageCache\com.unity.textmeshpro@2.0.1\Scripts\Editor\TMP_PackageUtilities.cs(310,17): error CS0433: The type 'Task' exists in both 'Unity.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    Also this error only started when I imported the GitHub Xbox Live package.
     
    Last edited: Oct 23, 2019
  11. Harinezumi

    Harinezumi

    Joined:
    Jan 7, 2013
    Posts:
    54
    I also get the same error, for a project that previously worked. I tried resetting the packages - no change, the same error. Downgrading to version 1.4 (as suggested in other places) is not an option, because I'm using Unity 2019.3, which is incompatible with 1.4.

    Any suggestions?

    EDIT: This Stack Overflow post solves the issue: https://stackoverflow.com/questions...-task-exist-in-both-unity-tasks-and-mscorelib

    In case of link rot, here's the text of the solution:
    I had the same issue and fixed it. Looks like this version of TextMeshPro references all of the libraries in your project. You can change that by changing the cached package files. More precisely, you can add this line

    "overrideReferences": true,

    to

    "(Your Project Directory)\Library\PackageCache\com.unity.textmeshpro@2.0.1\Scripts\Editor\ Unity.TextMeshPro.Editor.asmdef"

    by opening it in a text editor.

    That will make the TextMesh Pro Editor code reference only the assemblies in this file opposite to all of the compiled assemblies in the project. the file will look like this:

    Code (CSharp):
    1.     {
    2.  
    3.        "name": "Unity.TextMeshPro.Editor",
    4.  
    5.        "references": [
    6.  
    7.            "Unity.TextMeshPro",
    8.  
    9.            "Unity.ugui",
    10.  
    11.            "Unity.ugui.Editor"
    12.  
    13.        ],
    14.  
    15.        "optionalUnityReferences": [],
    16.  
    17.        "overrideReferences": true,
    18.  
    19.        "includePlatforms": [
    20.  
    21.            "Editor"
    22.  
    23.        ],
    24.  
    25.        "excludePlatforms": []
    26.  
    27.    }
    The second option is to remove the TextMesh Pro Package. If you are sure that the project does not use it, you can use the top menu "Window -> Package Manager". Then in the Packages window, in the list select TextMesh Pro and click "Remove".
     
    Last edited: May 15, 2020