Search Unity

UnityException: Failed assemblies stripper:

Discussion in 'iOS and tvOS' started by impla007, Oct 29, 2010.

  1. impla007

    impla007

    Joined:
    Jan 30, 2010
    Posts:
    57
    Help !!!!!

    I do not understand what happened !!!, I do not see what I did wrong ???

    Suddenly I cannot build my project anymore ! it seem it is missing "get_ContainsGenericParameters()"
    When building for iPhone I get this error on the console :


    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/BuildTargetTools/iPhonePlayer/link.xml" -d "Temp/StagingArea/Data/Managed" -x "tmplink.xml" current dir : Temp/StagingArea/Data/Managed std=  err=
    2. Unhandled Exception: Mono.Linker.ResolutionException: Can not resolve reference: System.Boolean System.Type::get_ContainsGenericParameters()
    3.   at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference, System.Object markedby) [0x00000] in <filename unknown>:0
    4.   at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction, Mono.Cecil.MethodDefinition markedby) [0x00000] in <filename unknown>:0
    5.   at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in <filename unknown>:0
    6.   at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0
    7.   at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0
    8.   at Mono.Linker.Steps.MarkStep.Process () [0x00000] in <filename unknown>:0
    9.   at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
    10.   at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
    11.   at UnusedBytecodeStripper.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
    12.  
    13.  output:
    14.  result file exists: False
    15. UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultFile)
    16. UnityEditor.MonoAssemblyStripping.MonoLink (BuildTarget buildTarget, System.String managedLibrariesDirectory, System.String[] input, UnityEditor.RuntimeClassRegistry usedClasses)
    17. UnityEditor.HostView:OnGUI()
    18.  
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    This has been reported as a bug (possibly by you) within the last few days but there is no resolution as yet.
     
  3. impla007

    impla007

    Joined:
    Jan 30, 2010
    Posts:
    57
    YEs Andeeee I made a bug report : (Case 380304)

    I have continued to investigate yesterday late.

    1) when I have no stripping, the bug disappears but it crashes during execution.

    2) Continuing to investigate, then, in one of my scripts, I had the following :

    Code (csharp):
    1. static var script ;
    2.  
    3. function Start() {
    4.     scoreObj = GameObject.Find("ScoreGUI");
    5.     script = scoreObj.GetComponent("ScoreManager");
    6. }
    No problem in the editor.


    then, I changed the declaration to :
    Code (csharp):
    1.  
    2. static var script : ScoreManager;
    3.  
    And I do not encounter the bug anymore, and I can build for iPhone with micro mscorelib.

    Hope it helps.
     
  4. aerende

    aerende

    Joined:
    Apr 27, 2009
    Posts:
    316
    Is there any resolution on this bug? I am seeing the same problem.
     
  5. aerende

    aerende

    Joined:
    Apr 27, 2009
    Posts:
    316
    Unity's Fogbugz doesn't have a case number 380304. Is this bug listed under another case number?
     
  6. dacotahturner

    dacotahturner

    Joined:
    Dec 20, 2009
    Posts:
    5
    I am also getting this bug. I have changed all of my static variables so that they are no longer dynamic datatypes. Is there any fix or is there any other issue that could cause this? I did get it to run by using stripping assemblies, but it crashed eventually.
     
  7. dacotahturner

    dacotahturner

    Joined:
    Dec 20, 2009
    Posts:
    5
    I just wanted to add that this bug on my end was worked out. I did it by avoiding any dynamic data types, essentially adding #pragma strict at the top of all of my .js scripts. This was a bit of a hassel, but I tried everything I could find. This ended up helping because I moved away from the more expensive .net data types where and only kept the ones that were absolutely necessary. This was kind of my last resort though. I also changed the name of the build as a whole in the player settings. I'm not sure which of those two things fixed this problem, but I'm not getting it anymore.

    also just in case you are wondering to force types in .js you add " as [ComponentType]"
     
  8. J3-Gaming

    J3-Gaming

    Joined:
    Dec 23, 2010
    Posts:
    55
    I am seeing this bug now too.

    Using C#
    Unity 3.4.2f3

    Code (csharp):
    1.  
    2. 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" -a "LitJson.dll" -a "relasphere-ar.dll" -out output -x "/Applications/Unity/Unity.app/Contents/BuildTargetTools/iPhonePlayer/link.xml" -d "Temp/StagingArea/Data/Managed" -x "tmplink.xml" current dir : Temp/StagingArea/Data/Managed
    3.  result file exists: False
    4. stdout:
    5. stderr: Unhandled Exception: Mono.Linker.ResolutionException: Can not resolve reference: System.IO.FileInfo[] System.IO.DirectoryInfo::GetFiles(System.String,System.IO.SearchOption)  at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference, System.Object markedby) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction, Mono.Cecil.MethodDefinition markedby) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.Process () [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
    6.  
    7. UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultFile)
    8. UnityEditor.MonoAssemblyStripping.MonoLink (BuildTarget buildTarget, System.String managedLibrariesDirectory, System.String[] input, UnityEditor.RuntimeClassRegistry usedClasses)
    9. UnityEditor.HostView:OnGUI()
    10.  
    Code (csharp):
    1.  
    2. Error building Player: Building player scripts failed.
    3. UnityEditor.HostView:OnGUI()
    4.  
    Code (csharp):
    1.  
    2. Exception: Error building Player: Building player scripts failed.
    3. UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions)
    4. UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder)
    5. UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings ()
    6. UnityEditor.BuildPlayerWindow.OnGUI ()
    7. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    8. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    9. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    10. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    11. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj)
    12. UnityEditor.HostView.Invoke (System.String methodName)
    13. UnityEditor.HostView.OnGUI ()
    14.  
     
  9. buffonomics

    buffonomics

    Joined:
    Jun 10, 2009
    Posts:
    59
    I got this problem too. Resolved it.
    Essentially, this only happens when you enable Byte Stripping AND if you are using certain external dlls.

    In my case it was the aperture dll from the Aperture CutScene tool. (Luckily I already used Unity's own very capable animation editor to create my cutscenes, so it wasn't a loss). If you delete these tools and dlls from your project, you will be able to use the bytecode stripping.

    E.g @MightyGoober, I would say try ding away with whatever uses "LitJson.dll" and "relasphere-ar.dll" in your project.
    If you absolutely must have these external dlls, then you cannot use Bytecde stripping at this time. You will have to export a bigger-sized Game.
    Hope this helped someone and also the awesome folks at Unity in their debugging.

    Cheers
     
  10. jackpile

    jackpile

    Joined:
    Apr 13, 2011
    Posts:
    27
    @buffonomics, thanks for your post. I am getting this error too now and am using 3.4.2f2 Pro for iOS as well and trying to strip down to mscorlib. I'm still green wrt C# assemblies and dll's. How can I tell what dll's might deter stripping? Where are they listed in the compiler output in the log? Here's my log. I probably didn't include enough here. Thanks in advance for suggestions/pointers.

    Code (csharp):
    1. UnityException: Failed assemblies stripper: /Applications/Unity 3.4.2/Unity.app/Contents/Frameworks/Mono/bin/mono "/Applications/Unity 3.4.2/Unity.app/Contents/Frameworks/Tools/UnusedBytecodeStripper/UnusedBytecodeStripper.exe" -l none -c link -a "Assembly-CSharp-firstpass.dll" -a "Assembly-CSharp.dll" -a "Assembly-UnityScript-firstpass.dll" -a "Assembly-UnityScript.dll" -a "C5.dll" -out output -x "/Applications/Unity 3.4.2/Unity.app/Contents/BuildTargetTools/iPhonePlayer/link.xml" -d "Temp/StagingArea/Data/Managed" -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.Type System.Type::MakeGenericType(System.Type[])  at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference, System.Object markedby) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction, Mono.Cecil.MethodDefinition markedby) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0   at Mono.Linker.Steps.MarkStep.Process () [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 resultFile)
    7. UnityEditor.MonoAssemblyStripping.MonoLink (BuildTarget buildTarget, System.String managedLibrariesDirectory, System.String[] input, UnityEditor.RuntimeClassRegistry usedClasses)
    8. UnityEditor.HostView:OnGUI()
    9.  
    10. Exception: Error building Player: Building player scripts failed.
    11. UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions)
    12. UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder)
    13. UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings ()
    14. UnityEditor.BuildPlayerWindow.OnGUI ()
    15. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    16. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    17. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    18. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    19. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj)
    20. UnityEditor.HostView.Invoke (System.String methodName)
    21. UnityEditor.HostView.OnGUI ()
    22.  
    23.  
     
  11. buffonomics

    buffonomics

    Joined:
    Jun 10, 2009
    Posts:
    59
    @jackpile your problem is likely the use of whatever uses C5.dll :)


    The potential trouble maker is usually after:

    "Assembly-UnityScript.dll"


    And before:

    "some unity-based XML. IPhone in your case"
    .

    See if you can do without whatever uses that dll.
    But don't feel too cheated if you can't strip. It's not like you are building for Android which requires a certain hard APK limit of which things become very complicated if you cross. iOS doesn't care about size, and the stripping would only save you just less than 10 megs anyway.
     
  12. ddf

    ddf

    Joined:
    Jul 9, 2011
    Posts:
    54
    Hey, good times, I get this now when trying to "Use micro mscorlib", and I don't see any extra dlls listed in the error, so what gives?

    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" -out output -x "/Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedBytecodeStripper/link.xml" -d "Temp/StagingArea/Data/Managed" -x "tmplink.xml" current dir : Temp/StagingArea/Data/Managed
    result file exists: False
    stdout:
    stderr: Unhandled Exception: Mono.Linker.ResolutionException: Can not resolve reference: System.Void System.Security.SecurityException::.ctor(System.String) at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference, System.Object markedby) [0x00000] in <filename unknown>:0 at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction, Mono.Cecil.MethodDefinition markedby) [0x00000] in <filename unknown>:0 at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in <filename unknown>:0 at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0 at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0 at Mono.Linker.Steps.MarkStep.Process () [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

    UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile)
    UnityEditor.MonoAssemblyStripping.MonoLink (BuildTarget buildTarget, System.String managedLibrariesDirectory, System.String[] input, System.String[] allAssemblies, UnityEditor.RuntimeClassRegistry usedClasses)
    UnityEditor.HostView:OnGUI()
     
  13. robhuhn

    robhuhn

    Joined:
    Jun 21, 2009
    Posts:
    113
    Hi, just having the same issue. It's a vague idea but could it happen because of dynamic typing? If I switch to "Strip ByteCode" the app will crash due to another error when using binaryFormatter.Serialize(memoryStream, graph); where graph is type of 'object'.

    Using "Strip ByteCode" caused by Serialize:
    "ExecutionEngineException: Attempting to JIT compile method 'List`1__TypeMetadata:.ctor ()' while running with --aot-only."

    Using "micro mscorlib":
    UnityException: Failed assemblies stripper: /Applications/Unity3x/Unity.app/Contents/Frameworks/Mono/bin/mono "/Applications/Unity3x/Unity.app/Contents/Frameworks/Tools/UnusedBytecodeStripper/UnusedBytecodeStripper.exe" -l none -c link -a "Assembly-CSharp-firstpass.dll" -a "Assembly-CSharp.dll" -out output -x "/Applications/Unity3x/Unity.app/Contents/Frameworks/Tools/UnusedBytecodeStripper/link.xml" -d "Temp/StagingArea/Data/Managed" -x "tmplink.xml" current dir : Temp/StagingArea/Data/Managed
    result file exists: False
    stdout:
    stderr: Unhandled Exception: Mono.Linker.ResolutionException: Can not resolve reference: System.Void System.Security.SecurityCriticalAttribute::.ctor(System.Security.SecurityCriticalScope) at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference, System.Object markedby) [0x00000] in <filename unknown>:0 at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in <filename unknown>:0 at Mono.Linker.Steps.MarkStep.MarkCustomAttribute (Mono.Cecil.CustomAttribute ca) [0x00000] in <filename unknown>:0 at Mono.Linker.Steps.MarkStep.MarkCustomAttributes (ICustomAttributeProvider provider) [0x00000] in <filename unknown>:0 at Mono.Linker.Steps.MarkStep.MarkAssembly (Mono.Cecil.AssemblyDefinition assembly) [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

    UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile)
    UnityEditor.MonoAssemblyStripping.MonoLink (BuildTarget buildTarget, System.String managedLibrariesDirectory, System.String[] input, System.String[] allAssemblies, UnityEditor.RuntimeClassRegistry usedClasses)
    UnityEditor.HostView:OnGUI()
     
  14. Jamda

    Jamda

    Joined:
    Apr 3, 2013
    Posts:
    6
    Had the same problem - thanks for the post, it saved me!!! My issue was resolved in player settings by disabling Stripping Level and setting the Script Call Optimization to Slow and Safe.
     
  15. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    You should always do this for Javascript no matter what.
     
  16. Yamilla

    Yamilla

    Joined:
    Mar 7, 2013
    Posts:
    6
    .
     
    Last edited: Jan 29, 2014
  17. Teku-Studios

    Teku-Studios

    Joined:
    Sep 29, 2012
    Posts:
    257
    We've got a similar problem than @Yamilla when building for Wii U, and a similar setup too.

    We get 12 "System.Exception: Failed making RPL" events.
     
  18. Teku-Studios

    Teku-Studios

    Joined:
    Sep 29, 2012
    Posts:
    257
    @Yamilla Ok, we found the solution! It was just the lack of environment variables configuration. Here's what you need to do step-by-step to successfully build a project for Wii U (follow cafe docs for a deeper approach on installation steps):

    Installs
    Install Unity WiiU
    Install CAFESDK (unzip) at “C:\” (root directory)
    Install Multi
    Install CYGWIN (32 bit) at “C:\” (root directory)

    Env. variables
    Add C:\cygwin to “Path” environment variable
    Add var CAFE_ROOT -> C:\cafe_sdk
    Add var CYGWIN_PATH -> C:\cygwin
    Add var GHS_ROOT -> C:\ghs\multi5321
    Add var BRIDGE_IP_ADDRESS -> Wii U's IP
    Add var BRIDGE_CURRENT_NAME -> Wii U's MAC Address
    Add var MION_BRIDGE_TOOLS -> C:\Program files\Nintendo\Hostbridge

    Last step

    Install Host Bridge
    Access to Wii U IP from browser to setup stuff


    We are also posting this on the forums as a separate thread:
    http://forum.unity3d.com/threads/20...ii-U-(-quot-Failed-making-RPL-quot-and-so-on)
     
    Last edited: Sep 12, 2013
  19. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    142
    I have had this problem on two occasions over the last year and am pretty sure that the problem lies in having incorrect symbols in script names.
    I think i solved it both times by removing"" from a script name.
     
    OceanBlue likes this.
  20. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Had this error too on production.
    Network programmer found out that he committed a file originally called "FullSerializer - Unity.dll" and then renamed it to "FullSerializer.dll".

    Into the Editor no error at all, but finally an error was committed on iOS compilation and still refering to the "FullSerializer - Unity.dll" file.
    Finally it seems the file couldn't be renamed or would always commit an error during build.

    It took a while to find it out.
    Also last thing, switching to stripping level StripByteCode also helped to have a more specific error message on compilation.

    The error can also be reference as (Unity 5.0.1f1) :

    - Cross Compilation job Assembly-CSharp.dll failed
    - Unity Exception: Cross compilation Failed
    - AssemblyResolutionException
    - Error building player : Building player scripts failed.

    Hope it helps other folks ;)