Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Micro mscorlib working with Android builds but not iOS builds

Discussion in 'Editor & General Support' started by GH-Spencer, Jun 6, 2013.

  1. GH-Spencer

    GH-Spencer

    Joined:
    Jun 6, 2013
    Posts:
    4
    When compiling our project under Android using the micro mscorlib optimization, the game compiles just fine. When switching over to iOS and attempting to build, this exception is raised:

    Code (csharp):
    1. UnityException: Failed assemblies stripper: /Applications/Unity/Unity.app/Contents/Frameworks/Mono/bin/mono "/Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper/UnusedBytecodeStripper.exe" -l none -c link -a "Assembly-CSharp-firstpass.dll" -a "Assembly-CSharp.dll" -a "Assembly-UnityScript.dll" -out output -x "/Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper/link.xml" -d "Temp/StagingArea/Data/Managed" -x "/Users/spencerelliot/BossRace/Assets/link.xml" -x "tmplink.xml" current dir : Temp/StagingArea/Data/Managed
    2.  result file exists: False
    3. stdout:
    4. stderr: Unhandled Exception: Mono.Linker.ResolutionException: Can not resolve reference: System.Security.Policy.Evidence  at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference, System.Object markedby) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.MarkField (Mono.Cecil.FieldReference reference, System.Object markedby) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.MarkFields (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0   at UnusedBytecodeStripper.VerboseMarkStep.ApplyPreserveInfo (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference, System.Object markedby) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.InitializeType (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0   at UnusedBytecodeStripper.VerboseMarkStep.InitializeType (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.InitializeAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.Initialize () [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0   at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0   at UnusedBytecodeStripper.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
    5.  
    6. UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile)
    7. UnityEditor.MonoAssemblyStripping.MonoLink (BuildTarget buildTarget, System.String managedLibrariesDirectory, System.String[] input, System.String[] allAssemblies, UnityEditor.RuntimeClassRegistry usedClasses)
    8. UnityEditor.HostView:OnGUI()
    I've attempted to keep various classes in using the link.xml file and it has allowed the compiler to get further but it won't find the System.Security.Policy.Evidence class no matter what I put in. This is my link.xml file:

    Code (csharp):
    1. <linker>
    2.     <assembly fullname="System">
    3.         <type fullname="System.*" preserve="all"/>
    4.     </assembly>
    5.  
    6.     <assembly fullname="System.Security">
    7.         <type fullname="System.Security.*" preserve="all"/>
    8.     </assembly>
    9.  
    10.     <assembly fullname="Mono.Security">
    11.         <type fullname="Mono.Security.*" preserve="all"/>
    12.     </assembly>
    13.  
    14.     <assembly fullname="mscorlib">
    15.         <namespace fullname="System.*" preserve="all"/>
    16.         <namespace fullname="System.Runtime.*" preserve="all"/>
    17.         <namespace fullname="System.Security.*" preserve="all"/>
    18.         <namespace fullname="System.Security.Policy.*" preserve="all"/>
    19.         <namespace fullname="System.Security.Cryptography.*" preserve="all"/>
    20.     </assembly>
    21. </linker>
    Any help is greatly appreciated, thanks.
     
  2. gc_hhatinen

    gc_hhatinen

    Joined:
    Jun 10, 2013
    Posts:
    1
    Did you find a solution? I'm currently struggling with the exact same problem.
     
  3. Dadaze

    Dadaze

    Joined:
    Sep 21, 2012
    Posts:
    24
    Do you use HOTween? My guess is that you use a plugin that cannot be compiled in mscorlib with iOS, just like HOTween's stock release