Search Unity

2018.3 PrecompiledAssemblyException: Multiple precompiled assemblies with the same name

Discussion in 'Editor & General Support' started by MayhemMike, Dec 19, 2018.

  1. MayhemMike

    MayhemMike

    Joined:
    Oct 23, 2013
    Posts:
    51
    Hello there,
    I tried to upgrade from 2018.2.20 to 2018.3 today and I keep getting this error. Initially there were more but after Reimporting all assets and later deleting the Library folder I could get rid of them. This one is the only one that sticks. I'm not very familiar with assemblies in Unity so any help to deal with that would be very welcome!
    Thanks.

    PrecompiledAssemblyException: Multiple precompiled assemblies with the same name UnityEngine.Advertisements.Editor.dll included for the current platform. Only one assembly with the same name is allowed per platform. Assembly path: {0}
    UnityEditor.Scripting.ScriptCompilation.EditorBuildRules.CreateTargetAssemblies (System.Collections.Generic.IEnumerable`1[T] customScriptAssemblies, System.Collections.Generic.IEnumerable`1[T] precompiledAssemblies) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorBuildRules.cs:249)
    UnityEditor.Scripting.ScriptCompilation.EditorCompilation.UpdateCustomTargetAssemblies () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:619)
    UnityEditor.Scripting.ScriptCompilation.EditorCompilation.SetAllCustomScriptAssemblyJsons (System.String[] paths) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:728)
    UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.SetAllCustomScriptAssemblyJsons (System.String[] allAssemblyJsons) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:217)
     
  2. kyleshell

    kyleshell

    Joined:
    Jul 28, 2017
    Posts:
    10
    Had the same error message, also in 2018.3. Except I got mine from importing a package from one project to another. The project already had Unity Monetization 3.0 built in to it. Not quite sure what I need to fix here to make this work, but I'm going to try commenting out all of the ad code, re-import monetization 3.0 and see if that works. Were you using the monetization asset or just the standard Unity advertisement package?

    Update: Upon further investigation, it seems the error is completely linked to a Unity Monetization 3.0 error. I am also getting the following error message 3 times along with the other error message.

    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.

    error CS1704: An assembly with the same simple name 'UnityEngine.Advertisements.Editor' has already been imported. Try removing one of the references (e.g. 'C:\Users\userName\Documents\Game Name\Library\PackageCache\com.unity.ads@2.3.1\Runtime\UnityEngine.Advertisements.Editor.dll') or sign them to enable side-by-side.

    This seems to offer a solution, but there doesn't seem to be duplicate references in that file location. In my code references, it seem that UnityUngine.Advertisement and UnityEnginge.Advertisement.Editor both have references to Advertisement. I assume one stems from Monitization 3.0 and the other from the Advertisement Package. However, this worked just fine in the project I am importing from. I'll let you know if I figure out the fix.

    Fix: This worked for me, but it may not work for you depending on your circumstance, but I simply commented out all references to Advertisement, ie. Advertisement.Show() and Hide(). Went to windows > package manager and removed the advertisement package from the project. Uncommented and the error went away. Hopefully this is helpful to you.
     
    Last edited: Dec 21, 2018
  3. MdevM

    MdevM

    Joined:
    Sep 28, 2017
    Posts:
    43
    I have the same problem with no unity update, tried all solutions, still occurs.
     
    ina likes this.
  4. NghiaChiHa

    NghiaChiHa

    Joined:
    Dec 31, 2018
    Posts:
    1
    Hello. i think i solved this problem in 2 days. In Asset/UnityAds/ i delete those 4 .dll file then my game is working again, the ads is still working fine. tested in android phone
     
    Duke-Driss likes this.
  5. vntu

    vntu

    Joined:
    Jan 13, 2019
    Posts:
    1
    For me removing library folder worked, cause it forsed assets reimport.
     
  6. MoonbladeStudios

    MoonbladeStudios

    Joined:
    Oct 14, 2013
    Posts:
    185
    Here is my solution. I had the same error with mono.cecil.dll or something like that.
    I search the file in Library\PackageCache found it and delete one of the package containing it (you need to also remove the package from Packages\manifest.json.and it works, Basically I remove t he package that contains it (I need to do this manually because Package manager didn't load because of the error).
    It seams to be a problem (at least in my case) with to dlls with the same name in 2 different packages).
    Hope this helps.
     
  7. Awkin

    Awkin

    Joined:
    Aug 24, 2018
    Posts:
    3
    What file did you delete from the Packagecache?
     
  8. MoonbladeStudios

    MoonbladeStudios

    Joined:
    Oct 14, 2013
    Posts:
    185
    I don't remember exactly which one, but you can make a back-up. One was from a package who was in the package manager and the other one was not. I removed the later.
    Hope this helps
     
  9. ThinhHB

    ThinhHB

    Joined:
    Oct 24, 2014
    Posts:
    11
    I got the same issue when import the UnityFacebookSDK to project. Turn out there are duplicated libraries, they have two Facebook.Unity.Android.dlls and two Facebook.Unity.IOS.dlls. Here my solution:
    • Goto FacebookSDK/Plugins/Android : delete the Facebook.Unity.IOS.dll in that folder
    • Goto FacebookSDK/Plugins/IOS : delete the Facebook.Unity.Android.dll
    • Exit Unity
    • Goto the project Library folder : delete PackageCache and ScriptAssemblies folder
    • Restart Unity to let it rebuild the two folders we just delete
    It worked for me, hope it'll help you.
     
  10. IcyGuy

    IcyGuy

    Joined:
    Nov 5, 2018
    Posts:
    1
    Thank you so much for the solution ThinhHB, I was having this exact issue after adding FacebookSDK.
     
  11. SheduMan

    SheduMan

    Joined:
    Aug 2, 2017
    Posts:
    5
    Worked for me also after installing 2019.1.10f1
     
  12. mTome

    mTome

    Joined:
    Mar 18, 2019
    Posts:
    2
    If you select the .dll file, there is "select platforms for plugin" option in inspector. You probably have the duplicated .dlls aiming same platforms.

    So another possible solution:
    • Go to FacebookSDK/Plugins/Android : select IOS and Android dlls and choose Android platform.
    • Go to FacebookSDK/Plugins/IOS: select IOS and Android dlls and choose IOS platform.
    I think this should work.
     
    kenkinky and praleks0000 like this.
  13. vinoth_mani

    vinoth_mani

    Joined:
    May 12, 2020
    Posts:
    1
    PrecompiledAssemblyException: Multiple precompiled assemblies with the same name UnityEditor.WindowsStandalone.Extensions.dll included for the current platform. Only one assembly with the same name is allowed per platform
    C:\Program Files\Unity_2019.3.15f1\Editor\Data\PlaybackEngines\windowsstandalonesupport\UnityEditor.WindowsStandalone.Extensions.dll
    C:\Program Files\Unity_2019.3.15f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll

    while checking directory I'm not able to find this directory "C:\Program Files\Unity_2019.3.15f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll "

    do anyone faced this issue in unity 2019?
     
  14. andrew_pearce

    andrew_pearce

    Joined:
    Aug 5, 2019
    Posts:
    9
    I am not sure about 2019 but I just got this bug in 2018.4 after I enabled In-App Purchasing. Now I cannot see Packager Manager and even resetting project to previous commit does not help. I have to search all places where Unity put their sh... and remove it manually. I hope that will help me get at least project back.

    SOLUTION: So I am not 100% sure what was the problem but here is what I did. First I reset all packages to default from Help menu. Then I restarted Unity and imported Firebase packages (analytics, remote config, etc). The restart again and finally removed Fabric folder, since Google no longer support it, the package manager was not able to update it. I waiting for 30 sec while Unity was compiling something and finally Package Manager is back. I hope it will save someone time.
     
    Last edited: Jul 24, 2020
    DjCtavia likes this.
  15. kansaslml

    kansaslml

    Joined:
    Nov 15, 2020
    Posts:
    1
    It happens to me in 2020.1.7f1 if i solve it i will update
     
  16. mahdi-malv

    mahdi-malv

    Joined:
    Jul 14, 2019
    Posts:
    4
    In my case it was because I was testing my project on multiple versions of Unity engine (2018, 2019).
    I solved it by removing any auto-generated folder by the engine before opening the project
     
  17. ahmedfouniq789

    ahmedfouniq789

    Joined:
    Jul 3, 2020
    Posts:
    1
    PrecompiledAssemblyException: Multiple precompiled assemblies with the same name Google.VersionHandler.dll included for the current platform. Only one assembly with the same name is allowed per platform. Assembly path: {0}
    UnityEditor.Scripting.ScriptCompilation.EditorBuildRules.CreateTargetAssemblies (System.Collections.Generic.IEnumerable`1[T] customScriptAssemblies, System.Collections.Generic.IEnumerable`1[T] precompiledAssemblies) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorBuildRules.cs:221)
    UnityEditor.Scripting.ScriptCompilation.EditorCompilation.UpdateCustomTargetAssemblies () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:672)
    UnityEditor.Scripting.ScriptCompilation.EditorCompilation.SetAllCustomScriptAssemblyJsonContents (System.String[] paths, System.String[] contents, System.String[] guids) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:892)
    UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.SetAllCustomScriptAssemblyJsonContents (System.String[] allAssemblyJsonPaths, System.String[] allAssemblyJsonContents, System.String[] guids) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Sc
     
  18. PedroGomas

    PedroGomas

    Joined:
    May 11, 2017
    Posts:
    3
    you have files for ios and android on plugins for multi plataforms , you have to uncheck the target plataforms in that file.
     
  19. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    Same 2021.2.
     
  20. ameralay

    ameralay

    Joined:
    May 6, 2014
    Posts:
    9
    Thanks a lot man that worked for me for another dll with the same issue!
     
  21. andacoban

    andacoban

    Joined:
    Apr 10, 2022
    Posts:
    5
    upload_2022-6-13_22-18-39.png
    I tried your way. Facebook Tabs appear and errors are solved but. URP was deleted. Any methods should I fix ?