Error on OSX

Create issue
Issue #2 resolved
Alexandre Tolstenko Nogueira created an issue

Hello, I downloaded your zip file and followed your instructional video but I encountered this error after reloading the project on Unity 5.3.4:

error CS1704: An assembly with the same name `UnityEditor.iOS.Extensions.Xcode' has already been imported. Consider removing one of the references or sign the assembly
/Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Xcode.dll (Location of the symbol related to previous error)
/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll (Location of the symbol related to previous error)
error CS1704: An assembly with the same name `UnityEditor.iOS.Extensions.Common' has already been imported. Consider removing one of the references or sign the assembly
/Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Common.dll (Location of the symbol related to previous error)
/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Common.dll (Location of the symbol related to previous error)

Compilation failed: 2 error(s), 0 warnings

Comments (11)

  1. Alexandre Tolstenko Nogueira reporter

    Here is the full Log:

    ********************************************************************************
    *                      Wednesday, 13 April 2016 16:56:55                       *
    ********************************************************************************
    CSharpCompilerWrapper.exe version: 1.6.2.0
    Platform: Mac
    Target assembly: /Assembly-CSharp.dll
    Project directory: /Users/tolstenko/projects/aurus/fodicom
    Unity 'Data' or 'Frameworks' directory: /Applications/Unity/Unity.app/Contents/Frameworks
    Microsoft C# 6.0 compiler found, but it is not supported on the current platform. Looking for another compiler...
    Compiler: Mono C# 6.0
    
    - Compilation -----------------------------------------------
    
    Process: /usr/local/bin/mono
    Arguments: "/Users/tolstenko/projects/aurus/fodicom/CSharp60Support/mcs.exe" -sdk:2 -debug+ -langversion:Default @Temp/UnityTempFile-2efeed5d87aa543bab0e322f56a7b73d
    Exit code: 1
    Elapsed time: 0.42 sec
    
    - Compiler output (1 line):
    0: Compilation failed: 2 error(s), 0 warnings
    
    - Compiler errors (6 lines):
    0: error CS1704: An assembly with the same name `UnityEditor.iOS.Extensions.Xcode' has already been imported. Consider removing one of the references or sign the assembly
    1: /Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Xcode.dll (Location of the symbol related to previous error)
    2: /Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll (Location of the symbol related to previous error)
    3: error CS1704: An assembly with the same name `UnityEditor.iOS.Extensions.Common' has already been imported. Consider removing one of the references or sign the assembly
    4: /Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Common.dll (Location of the symbol related to previous error)
    5: /Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Common.dll (Location of the symbol related to previous error)
    ********************************************************************************
    *                      Wednesday, 13 April 2016 16:59:00                       *
    ********************************************************************************
    CSharpCompilerWrapper.exe version: 1.6.2.0
    Platform: Mac
    Target assembly: /Assembly-CSharp.dll
    Project directory: /Users/tolstenko/projects/aurus/fodicom
    Unity 'Data' or 'Frameworks' directory: /Applications/Unity/Unity.app/Contents/Frameworks
    Microsoft C# 6.0 compiler found, but it is not supported on the current platform. Looking for another compiler...
    Compiler: Mono C# 6.0
    
    - Compilation -----------------------------------------------
    
    Process: /usr/local/bin/mono
    Arguments: "/Users/tolstenko/projects/aurus/fodicom/CSharp60Support/mcs.exe" -sdk:2 -debug+ -langversion:Default @Temp/UnityTempFile-fcc8bb0d2c7d64615bbcb564e872e6f1
    Exit code: 1
    Elapsed time: 0.29 sec
    
    - Compiler output (1 line):
    0: Compilation failed: 2 error(s), 0 warnings
    
    - Compiler errors (6 lines):
    0: error CS1704: An assembly with the same name `UnityEditor.iOS.Extensions.Xcode' has already been imported. Consider removing one of the references or sign the assembly
    1: /Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Xcode.dll (Location of the symbol related to previous error)
    2: /Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll (Location of the symbol related to previous error)
    3: error CS1704: An assembly with the same name `UnityEditor.iOS.Extensions.Common' has already been imported. Consider removing one of the references or sign the assembly
    4: /Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Common.dll (Location of the symbol related to previous error)
    5: /Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Common.dll (Location of the symbol related to previous error)
    
  2. Mathieu Frenette

    Hello Alex, First, thank you so much your great contribution! This is a huge step forward for the Unity community! :)

    Now, I also encounter the exact same issue with latest version (CSharp60Support 1.4.0).

    Here is a minimal repro project: https://dl.dropboxusercontent.com/u/14621128/HelloWorld.zip

    It's a blank/empty project into which I only extracted the CSharp60Support folder into the root and then imported the Unity 5 package. Then I did a Reimport All and immediately got the following error in the Unity console window:

    error CS1704: An assembly with the same name `UnityEditor.iOS.Extensions.Xcode' has already been imported. Consider removing one of the references or sign the assembly
    /Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Xcode.dll (Location of the symbol related to previous error)
    /Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll (Location of the symbol related to previous error)
    error CS1704: An assembly with the same name `UnityEditor.iOS.Extensions.Common' has already been imported. Consider removing one of the references or sign the assembly
    /Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Common.dll (Location of the symbol related to previous error)
    /Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Common.dll (Location of the symbol related to previous error)
    

    I am using latest Unity version (5.3.5) on Mac OS X El Capitan (10.11.5).

    Important: In order to reproduce the problem, both iOS and tvOS modules must be installed in Unity, because the problem arises from those two conflicting folders: /Applications/Unity/PlaybackEngines/AppleTVSupport and /Applications/Unity/PlaybackEngines/iOSSupport, which both contain 2 redundant DLLs.

    If I delete or move one of those folders away, the error disappears. This is very problematic, because I need to build both targets on the same machine. (I'm currently considering the ugly hack of configuring my build script to automatically move those folders in and out depending on the build target!)

    Unity's "Editor.log" shows the following "-r:" arguments in its compiler command line:

    -r:'/Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Xcode.dll'
    -r:'/Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Common.dll'
    -r:'/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll'
    -r:'/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Common.dll'
    

    Full Editor.log file available here: https://dl.dropboxusercontent.com/u/14621128/Editor.log

    I went quickly through the MonoCSharpCompiler source code and its parent classes here: https://github.com/MattRix/UnityDecompiled/blob/master/UnityEditor/UnityEditor.Scripting.Compilers/MonoCSharpCompiler.cs

    My understanding is that MonoCSharpCompiler (or a parent class) somehow dynamically discovers both folders and includes their DLLs as "-r:" references, but I could not find where it does such discovery. Maybe those references are being passed in via MonoIsland._references?

    Strangely, this only happens with CSharp60Support, not with regular compiler...

    Any help would be greatly appreciated!

    Kind regards :) Mathieu

  3. Mathieu Frenette

    Yeap! Imported the package into my HelloWorld project (but I left the CSharp60Support folder in the root as-is) and the error is gone! :) What was the issue?

    Thanks for the super fast response!

  4. Alex Zhdankin repo owner

    As far as I understand, error CS1704 should happen only when a project references two assemblies that

    1. have the same name,
    2. both are unsigned,
    3. have different version numbers.

    In our case the third condition isn't met, but Mono compiler still reports the error (Roslyn doesn't). Either it's a compiler bug or I'm just wrong.

  5. Log in to comment