unity3d build fails with byteStripping in 5.2 on osX

原文:http://answers.unity3d.com/questions/1065673/build-fails-with-bytestripping-in-52-on-osx.html   

consistently getting this error on build to iOS using unity 5.2 exact same build settings as I was using on 5.1 (full code stripping). Anyone else run into this? here is the console log:

Failed running /Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "/Users/Ben/Documents/Projects/Current/1411c Grumz/GrumzUnity copy/Temp/StagingArea/Data/Managed/tempStrip" -l none -c link -x "/Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper/native_link.xml" -f "/Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/LinkerDescriptors" -x "/Users/Ben/Documents/Projects/Current/1411c Grumz/GrumzUnity copy/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/Users/Ben/Documents/Projects/Current/1411c Grumz/GrumzUnity copy/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -d "/Users/Ben/Documents/Projects/Current/1411c Grumz/GrumzUnity copy/Temp/StagingArea/Data/Managed" -a "/Users/Ben/Documents/Projects/Current/1411c Grumz/GrumzUnity copy/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" -a "/Users/Ben/Documents/Projects/Current/1411c Grumz/GrumzUnity copy/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" -a "/Users/Ben/Documents/Projects/Current/1411c Grumz/GrumzUnity copy/Temp/StagingArea/Data/Managed/Assembly-UnityScript-firstpass.dll" -a "/Users/Ben/Documents/Projects/Current/1411c Grumz/GrumzUnity copy/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll" -a "/Users/Ben/Documents/Projects/Current/1411c Grumz/GrumzUnity copy/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" stdout: ERROR: Failed to resolve base type System.Security.Principal.GenericIdentity for type System.Net.HttpListenerBasicIdentity Fatal error in Mono CIL Linker System.Exception: ERROR: Failed to resolve base type System.Security.Principal.GenericIdentity for type System.Net.HttpListenerBasicIdentity at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.IsMonoBehaviourOrScriptableObject (Mono.Cecil.TypeDefinition type) [0x00000] in :0 at System.Linq.Enumerable+c__Iterator1E1[Mono.Cecil.TypeDefinition].MoveNext () [0x00000] in :0 at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.Process (Mono.Linker.LinkContext context) [0x00000] in :0 at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in :0 at Mono.Linker.Driver.Run () [0x00000] in :0 at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver) [0x00000] in :0 stderr: UnityEngine.Debug:LogError(Object) UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:66) UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable1, String&, String&, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:192) UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String, String&, String&, String, String, IEnumerable1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:185) UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:136) UnityEditorInternal.AssemblyStripper:Strip(String[], String[], String, String, String&, String&, String, String, IEnumerable1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:121) UnityEditorInternal.IL2CPPBuilder:RunAssemblyStripper(IEnumerable, String, String[], String[], String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:444) UnityEditorInternal.IL2CPPBuilder:StripAssemblies(IEnumerable1, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:417) UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:291) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211) UnityEditor.PostprocessBuildPlayer:Postprocess(BuildTarget, String, String, String, Int32, Int32, String, String, BuildOptions, RuntimeClassRegistry)

  The solution for me was to:

  1. Switch the project back to the Mono2x scripting backend.

  2. This reveals the "Stripping Level" control, which isn't used with IL2CPP backend. Switch to "disabled".

  3. Build the project (not sure if this was really required).

  4. Switch the project back to the IL2CPP scripting backend.

  5. The stripping level setting is replaced with the "strip engine code" setting again, which can be enabled.

The project now built for me without error. The only change to the project files was clearing the iPhoneStrippingLevel setting, which seems to be unused with IL2CPP scripting, but this resolved the error in my case.

发表评论