Search Unity

Multiple Precompiled Assemblies With the Same Name

Discussion in 'Scripting' started by Mashimaro7, Jun 16, 2021.

  1. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    I'm getting an error after I imported a package to Unity,

    Code (CSharp):
    1. Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included or the current platform. Only one assembly with the same name is allowed per platform. (Assets/Plugins/Newtonsoft Json/Runtime/AOT/Newtonsoft.Json.dll)
    I looked around for a solution, and people were saying it had to do with Unity Ads(which I don't have) and another solution I found was to delete one of the Newtonsoft.Json.dll files, which, if I delete either or the app fails to build. I don't even know how to get rid of the package that's caused it, nor do I really want to, the issue started after I imported this package,

    https://readyplayer.me/

    Is there any way to fix this?

    Thanks.

    Edit: The duplicate(that came with the above Unity package) seems to be coming from D:/VR-Chat/Library/PackageCache/com.unity.nuget.newtonsoft-json@2.0.0/Runtime/Newtonsoft.Json.dll)

    I tried deleting this one as well, the whole package, just to see what would happen. It automatically reimports it.
     
    Last edited: Jun 16, 2021
    dlsxcelgo likes this.
  2. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    Sorry, can anyone help with this, please?
     
    dlsxcelgo likes this.
  3. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    Bump
     
    dlsxcelgo likes this.
  4. As the error says, you have one too many. You need to remove one. Probably you should contact the readyplayer owners and inform them that including this 3rd-party package is in collision with other packages.

    If I'm understanding you correctly, the readyplayer is an asset. If it's true, you just need to remove the dll (Assets/Plugins/Newtonsoft Json/Runtime/AOT/Newtonsoft.Json.dll) from that.
    Please use caution, backup your project before you delete anything and/or use your version control system!

    All in all, the goal is to have only one file per target platform.
     
  5. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    I tried backing up this file and deleting it, in both packages. Either one causes an error that prevents building, i was able to build just fine before installing this asset...

    Yeah sorry, it's a unity package.
     
  6. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    Can someone please help with this? I had to remove the package, I have no idea how to get it working. My client would really like to use this package.
     
  7. adhochero

    adhochero

    Joined:
    Feb 2, 2017
    Posts:
    43
    I'm having the same issue
     
  8. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    dlsxcelgo likes this.
  9. zohaibjawed666

    zohaibjawed666

    Joined:
    Jun 11, 2021
    Posts:
    1
    Please help me how to resolve this problem,
    Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included or the current platform. Only one assembly with the same name is allowed per platform. (C:/Users/GAMEPLAY/Desktop/Train In Jungle/Library/PackageCache/com.unity.nuget.newtonsoft-json@2.0.0/Runtime/Newtonsoft.Json.dll)
     
  10. Mizhaeru

    Mizhaeru

    Joined:
    Aug 19, 2021
    Posts:
    1
    hi there, i dont know if this solution will help you but it helped me, i rename one of the dlls that was causing me problems in one of the paths, something such as Newtonsoft_old.Json.dll

    so unity only took 1 dll, hope it helps.
     
  11. ink13

    ink13

    Joined:
    Nov 14, 2013
    Posts:
    37
    No it's not mate, he's just saying that he too is facing the same problem. It's validation that the problem steps beyond just you that's facing it...
     
  12. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    It's rude in my opinion to hijack a thread over a month after it was posted and say "I'm having the same problem" without any further explanation, like look at the next guy's question, at least he asked nicely. Btw, why necro my post from 4 months ago just to call me out for calling the guy rude? XD
     
  13. ink13

    ink13

    Joined:
    Nov 14, 2013
    Posts:
    37
    > eh. it's the unity forums - time is a flat circle here.
     
  14. initer

    initer

    Joined:
    Nov 19, 2018
    Posts:
    8
    Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform. (Assets/UnityPackages/JsonNet/Newtonsoft.Json.dll)

    On quixel Unity plugin, any help?
     
  15. Thorny2000

    Thorny2000

    Joined:
    Sep 18, 2014
    Posts:
    53
    I believe Newtonsoft.json.dll is now included in Unity, like version 2020.3.24f1 LTS, it's broken a lot of peoples projects due to already being present. So much for the "LTS" logo meaning :)

    More on this here: Newtonsoft Json package | Page 2 - Unity Forum
     
    imDanOush likes this.
  16. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello i have the same problem, i tried deleting the Newton package but it keeps coming back by itself and keeps giving the same error message and i have to go into safemode.
     
  17. AlCaTrAzzGames

    AlCaTrAzzGames

    Joined:
    May 17, 2017
    Posts:
    25
    I'm having the same issue
     
  18. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    You can do it, bro. I believe in you.
     
  19. PrabhakarDeep

    PrabhakarDeep

    Joined:
    Jun 6, 2019
    Posts:
    6

    Well in project there was another file in the "Plugin" folder I deleted that Newtonsoft.json.dll file and the error disappeared.

    Hope it'll solve this issue for you.
     
  20. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    Yes, you need to delete the two extra Newtonsoft dlls.
     
    wmadwand likes this.
  21. XXSunaXX

    XXSunaXX

    Joined:
    Jan 20, 2022
    Posts:
    1
    Hi everyone, I have the same issue but with System.Test.Json.6.0.1. I spent like 5h hours on that and there is still the same problem... I need help please :(.
     

    Attached Files:

  22. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    It looks like you have a lot of packages... I think you'll need to find every extra copy and delete them all...Click on the error, it shows where they are. Backup to Git before deleting them, just in case.
     
  23. seansteezy

    seansteezy

    Joined:
    Nov 28, 2013
    Posts:
    122
    This is the correct answer - this is included in Unity 2021. Some 3rd party packages will have it built in (ROS# for me), but Unity does too, so one of them has to go, or you could go on renaming one of them all throughout your project, which is a pain in the butt.
     
    alexaso and TenaciousLibbs like this.
  24. TenaciousLibbs

    TenaciousLibbs

    Joined:
    Nov 26, 2012
    Posts:
    9
    seansteezy's post above solved this for me. Thank you!
     
  25. Mostyndarko

    Mostyndarko

    Joined:
    Feb 23, 2020
    Posts:
    3
    hambazumba2 likes this.
  26. amelia6789

    amelia6789

    Joined:
    May 14, 2022
    Posts:
    2


    Do you know where is the duplicate file. I am facing issues while using ROS# as well
     
  27. wangtaipeng

    wangtaipeng

    Joined:
    Nov 28, 2018
    Posts:
    2
    My problem is like this "Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform( " My project path on the computer "\Library\PackageCache\com.unity.nuget.newtonsoft-json@2.0.0\Runtime\Newtonsoft.Json.dll),
    Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform( Assets\UnityPackages\Newtonsoft.Json.dll),
    may be the same documents"Newtonsoft.Json.dll" in "My project path on the computer "\Library\PackageCache\com.unity.nuget.newtonsoft-json@2.0.0\Runtime" and "Assets\UnityPackages" are in conflicts with each other, then I delete the "Newtonsoft.Json.dll" doucument in the Unity project page then the problem disappeared
    upload_2022-11-21_18-1-44.png
     
  28. ankkol2011

    ankkol2011

    Joined:
    Jan 16, 2023
    Posts:
    1
  29. mjmorejon

    mjmorejon

    Joined:
    Jan 20, 2023
    Posts:
    1
  30. octallabs4

    octallabs4

    Joined:
    Jul 13, 2023
    Posts:
    1
    just Remove the Build Report
     
  31. grapemane

    grapemane

    Joined:
    Dec 1, 2020
    Posts:
    2
    I'm having the same issue
     
  32. Mashimaro7

    Mashimaro7

    Joined:
    Apr 10, 2020
    Posts:
    727
    You have to delete the extra, that's all. Sometimes there' will be two you have to remove.