Search Unity

Help needed after upgrading to 5.5.. CS1704 UnityEngine.UI already imported error

Discussion in 'Editor & General Support' started by MrKory, Dec 2, 2016.

  1. MrKory

    MrKory

    Joined:
    Sep 20, 2013
    Posts:
    66
    Hi everyone,

    I need some help with this.. sorry if it is a duplicate to something already asked.. If so, please point me to the solution or thread.

    I just upgraded Unity to 5.5 from 5.3.6f1 and can't quite figure out how to resolve an error. If anyone would be able to offer me some help here I would really appreciate it. I pasted the console output below.

    Thanks,
    -Kory

    error CS1704: An assembly with the same name `UnityEngine.UI' has already been imported. Consider removing one of the references or sign the assembly
    C:/Art_all_programs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll (Location of the symbol related to previous error)
    C:/Art_all_programs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll (Location of the symbol related to previous error)
    error CS1704: An assembly with the same name `UnityEngine.Networking' has already been imported. Consider removing one of the references or sign the assembly
    C:/Art_all_programs/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll (Location of the symbol related to previous error)
    C:/Art_all_programs/Unity/Editor/Data/UnityExtensions/Unity/Networking/Standalone/UnityEngine.Networking.dll (Location of the symbol related to previous error)
    error CS1704: An assembly with the same name `UnityEngine.HoloLens' has already been imported. Consider removing one of the references or sign the assembly
    C:/Art_all_programs/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Runtime/UnityEngine.HoloLens.dll (Location of the symbol related to previous error)
    C:/Art_all_programs/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll (Location of the symbol related to previous error)

    Compilation failed: 3 error(s), 0 warnings
     
    Iresh likes this.
  2. MrKory

    MrKory

    Joined:
    Sep 20, 2013
    Posts:
    66
    well I fixed it... Closed the editor and restarted it...
     
  3. Gowthaman

    Gowthaman

    Joined:
    Dec 3, 2016
    Posts:
    1
    it worked after i restarted my editor
    tnk u
     
  4. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    228
    Simply restarting the editor did not fix this issue for me.

    Rebuilding the Project Library by deleting the 'Library' folder and reloading the project this way however did solve it.
     
    GodlikeAurora, Mauri, Pn-io and 6 others like this.
  5. IndieDependent

    IndieDependent

    Joined:
    Dec 25, 2016
    Posts:
    1
    Finally upgraded to 5.5 from 5.3.x and playmaker is throwing this error. Do I delete the whole Library folder or just the metadata? Thanks in advance.
     
  6. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    228
    The entire folder. Let Unity rebuild everything from scratch so you won't have any other issues.
     
    Pn-io and Beguiled like this.
  7. pipulese

    pipulese

    Joined:
    Jan 11, 2017
    Posts:
    1
    Yes this worked I was almost at my wits end and thought I'd have to start all over again! Thanks so much!
     
  8. Kstu

    Kstu

    Joined:
    Jan 6, 2017
    Posts:
    1
    Thank you @Ghosthowl, I was throwing 23 editor errors after updating without any luck on restarting my cpu or unity.

    Deleting the library folder and having unity rebuild it from scratch did the trick. Cheers.
     
  9. Beguiled

    Beguiled

    Joined:
    Mar 15, 2014
    Posts:
    14
    This did the trick for me. Thanks!
     
  10. noio

    noio

    Joined:
    Dec 17, 2013
    Posts:
    232
    I'm getting a similar error for

    Code (CSharp):
    1. error CS1704: An assembly with the same name `XInputDotNetPure' has already been imported. Consider removing one of the references or sign the assembly
    2. Assets/Plugins/x86/XInputDotNetPure.dll (Location of the symbol related to previous error)
    3. Assets/Plugins/x86_64/XInputDotNetPure.dll (Location of the symbol related to previous error)
    4.  
    5. Compilation failed: 1 error(s), 0 warnings
    But deleting my Library folder (cache) does not solve it.
     
    KangHoNam likes this.
  11. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    The import settings in XInputDotNetPure are wrong.
    Assets/Plugins/x86/XInputDotNetPure.dll should be x86 only.
    Assets/Plugins/x86_64/XInputDotNetPure.dll should be x86-64 only.
    Unity no longer uses the hardwired paths that it used to to determine the platform, as of 5.0.
     
  12. noio

    noio

    Joined:
    Dec 17, 2013
    Posts:
    232
    Yup. That's exactly what they are set to:





    It's the first thing I checked. The settings were correct and it's still happening. :(
     
  13. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    Those are the platform settings for standalone builds, check the editor platform setting as well, it's the Unity icon tab.
     
  14. noio

    noio

    Joined:
    Dec 17, 2013
    Posts:
    232
    My problem is actually with Standalone builds.

    Regardless, the architecture is also set correctly for the Unity Editor.

     
  15. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    Unfortunately I'm out of ideas! :-/
     
  16. noio

    noio

    Joined:
    Dec 17, 2013
    Posts:
    232
    Thank you for your help though!

    I deleted the plugin to 'solve' the problem.
     
    kamathaj likes this.
  17. ksakins

    ksakins

    Joined:
    Aug 29, 2015
    Posts:
    16
    Restarting the editor also fixed this issue, along with several other compilation issues.
     
  18. yewchunyen

    yewchunyen

    Joined:
    Oct 3, 2017
    Posts:
    8
    Hi, may i know where is the library files?
     
  19. chico_barnstorm

    chico_barnstorm

    Joined:
    Jun 11, 2014
    Posts:
    10
    It's just the Library folder :)
     

    Attached Files:

  20. idriss2

    idriss2

    Joined:
    Dec 15, 2017
    Posts:
    1
    thank u MrKory it solved the probleme for me too
     
  21. Manu_Kumar

    Manu_Kumar

    Joined:
    Sep 1, 2014
    Posts:
    2
    WORKED! JUST RESTART THE EDITOR :D thank you everyone
     
  22. DictatorGames

    DictatorGames

    Joined:
    Oct 26, 2017
    Posts:
    3
    Just close the editor and restart my unity setup its work great and resolve this issue........
     
  23. bearkidder12

    bearkidder12

    Joined:
    Nov 6, 2018
    Posts:
    1
    this is still broken here
    error CS1704: An assembly with the same name `UnityEngine.UI' has already been imported. Consider removing one of the references or sign the assembly
     
  24. ManieBesselaar

    ManieBesselaar

    Joined:
    Nov 1, 2018
    Posts:
    30
    Hi everyone.
    Here is what worked for me for the error CS1704.

    In my case it was unity.tasks.dll and system.data.dll but I suspect the solution will work for most people with the error CS1704.

    I looked at this " Consider removing one of the references or sign the assembly Assets/PlayServicesResolver/Editor/Google.VersionHandler.dll (Location of the symbol related to previous error) " part of the error and noticed that the file names were the same. I looked at both versions of the dll files properties and then renamed the oldest version to <name>.dll.old and then recompiled to see if it would work. Eureka.

    I am a noob, so not sure why this is but here is my theory:
    Unity keeps a record of the plugin libraries for name space resolution (I think) which it rebuilds when something changes. (See Assembly-CSharp.csproj under project root, just a guess)
    When a new plugin gets added (or in my case I moved to dotnet 4.x from 3 ) it may contain the same dll of the same or different version. The name resolution records then ends up with 2 entries with the same name, for two different files. This means that a call to that library cannot be properly resolved.

    I hope that someone smarter than me reads this and corrects or improves my explanation so that I can learn to understand this better.

    Anyway, hope this helps someone.