unity5.2.4 build ios包错误

时间:2016-03-30 12:35:40

标签: unity3d unity5

构建ios包时遇到问题。

这是日志

日志是在windows(unity5.2.2f1)中构建的。

macOs中的相同错误(unity 5.2.4f1)

  

错误1:无法运行D:\ Program Files(x86)\ Unity \ Editor \ Data \ Tools / UnusedByteCodeStripper2 / UnusedBytecodeStripper2.exe -out" F:\ client1 \ Temp \ StagingArea \ Data \ Managed \ tempStrip&# 34; -l none -c link -x" D:\ Program Files(x86)\ Unity \ Editor \ Data \ Tools \ native_link.xml" -f" D:\ Program Files(x86)\ Unity \ Editor \ Data \ il2cpp \ LinkerDescriptors" -x" F:\ client1 \ Temp \ StagingArea \ Data \ Managed .. \ platform_native_link.xml" -x" F:\ client1 / Temp / StagingArea / Data / methods_pointedto_by_uievents.xml" -x" F:\ client1 \ Assets \ Scripts \ AStarScript \ link.xml" -d" F:\ client1 \ Temp \ StagingArea \ Data \ Managed" -a" F:\ client1 \ Temp \ StagingArea \ Data \ Managed \ Assembly-CSharp-firstpass.dll" -a" F:\ client1 \ Temp \ StagingArea \ Data \ Managed \ Assembly-CSharp.dll" -a" F:\ client1 \ Temp \ StagingArea \ Data \ Managed \ Assembly-UnityScript-firstpass.dll" -a" F:\ client1 \ Temp \ StagingArea \ Data \ Managed \ Assembly-UnityScript.dll" -a" F:\ client1 \ Temp \ StagingArea \ Data \ Managed \ UnityEngine.UI.dll"

     

标准输出:    SweepReport:    System.MonoType =&gt; Mono.Cecil.TypeDefinitionMono.Cecil.TypeDefinitionMono.Cecil.TypeDefinitionMono.Cecil.TypeDefinitionMono.Cecil.TypeDefinition    Mono.Cecil.MethodDefinition =&gt; System.Boolean System.EnterpriseServices.IConfigurationAttribute.AfterSaveChanges(System.Collections.Hashtable)System.Boolean System.EnterpriseServices.IConfigurationAttribute.Apply(System.Collections.Hashtable)System.Boolean System.EnterpriseServices.IConfigurationAttribute.IsValidTarget(System.String)System .Guid get_Value()System.Boolean System.EnterpriseServices.IConfigurationAttribute.AfterSaveChanges(System.Collections.Hashtable)    Mono.Cecil.FieldDefinition =&gt; System.String LiteralFalseSystem.String LiteralTrueSystem.String LiteralNullSystem.String LiteralUndefinedSystem.String LiteralNotANumber    Mono CIL Linker中的致命错误    Mono.Cecil.ResolutionException:无法解析System.Web.AspNetHostingPermissionLevel      在Mono.Cecil.Mixin.CheckedResolve(Mono.Cecil.TypeReference self)[0x00000] in:0      在Mono.Cecil.SignatureReader.ReadCustomAttributeEnum(Mono.Cecil.TypeReference enum_type)[0x00000] in:0      在Mono.Cecil.SignatureReader.ReadCustomAttributeElementValue(Mono.Cecil.TypeReference类型)[0x00000] in:0      在Mono.Cecil.SignatureReader.ReadCustomAttributeElement(Mono.Cecil.TypeReference类型)[0x00000] in:0      在Mono.Cecil.SignatureReader.ReadCustomAttributeFixedArgument(Mono.Cecil.TypeReference类型)[0x00000] in:0      在Mono.Cecil.SignatureReader.ReadCustomAttributeNamedArgument(Mono.Collections.Generic.Collection 1& fields, Mono.Collections.Generic.Collection 1&amp; properties)[0x00000] in:0      在Mono.Cecil.SignatureReader.ReadCustomAttributeNamedArguments(UInt16计数,Mono.Collections.Generic.Collection 1& fields, Mono.Collections.Generic.Collection 1&amp;属性)[0x00000] in:0      在Mono.Cecil.SignatureReader.ReadSecurityAttribute()[0x00000]中:0      在Mono.Cecil.MetadataReader.ReadSecurityDeclarationSignature(Mono.Cecil.SecurityDeclaration declaration)[0x00000] in:0      在Mono.Cecil.SecurityDeclaration.b__2(Mono.Cecil.SecurityDeclaration declaration,Mono.Cecil.MetadataReader reader)[0x00000] in:0      在Mono.Cecil.ModuleDefinition.Read [SecurityDeclaration,SecurityDeclaration](Mono.Cecil.SecurityDeclaration item,System.Func 3 read) [0x00000] in <filename unknown>:0 at Mono.Cecil.SecurityDeclaration.Resolve () [0x00000] in <filename unknown>:0 at Mono.Cecil.SecurityDeclaration.get_SecurityAttributes () [0x00000] in <filename unknown>:0 at Mono.Cecil.ImmediateModuleReader.ReadSecurityDeclarations (ISecurityDeclarationProvider provider) [0x00000] in <filename unknown>:0 at Mono.Cecil.ImmediateModuleReader.ReadType (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0 at Mono.Cecil.ImmediateModuleReader.ReadTypes (Mono.Collections.Generic.Collection 1种类型)[0x00000] in:0      在Mono.Cecil.ImmediateModuleReader.ReadModule(Mono.Cecil.ModuleDefinition模块)[0x00000] in:0      在Mono.Cecil.ModuleWriter.WriteModuleTo(Mono.Cecil.ModuleDefinition模块,System.IO.Stream流,Mono.Cecil.WriterParameters参数)[0x00000] in:0      在Mono.Cecil.ModuleDefinition.Write(System.IO.Stream stream,Mono.Cecil.WriterParameters参数)[0x00000] in:0      在Mono.Cecil.ModuleDefinition.Write(System.String fileName,Mono.Cecil.WriterParameters参数)[0x00000] in:0      在Mono.Cecil.AssemblyDefinition.Write(System.String fileName,Mono.Cecil.WriterParameters参数)[0x00000] in:0      在Mono.Linker.Steps.OutputStep.OutputAssembly(Mono.Cecil.AssemblyDefinition assembly)[0x00000] in:0      在Mono.Linker.Steps.OutputStep.ProcessAssembly(Mono.Cecil.AssemblyDefinition assembly)[0x00000] in:0      在Mono.Linker.Steps.BaseStep.Process(Mono.Linker.LinkContext context)[0x00000] in:0      在Mono.Linker.Pipeline.Process(Mono.Linker.LinkContext context)[0x00000] in:0      在Mono.Linker.Driver.Run()[0x00000]中:0      在Mono.Linker.Driver.RunDriver(Mono.Linker.Driver驱动程序)[0x00000] in:0    标准错误:

     

UnityEngine.Debug:LOGERROR(对象)    UnityEditorInternal.Runner:RunManagedProgram(String,String,String,CompilerOutputParserBase)(在C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:66)    UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable 1, String&, String&, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:192) UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String, String&, String&, String, String, IEnumerable 1)(在C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:185)    UnityEditorInternal.AssemblyStripper:Strip(String,String,String&amp;,String&amp;,String,String,IEnumerable 1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:136) UnityEditorInternal.AssemblyStripper:Strip(String[], String[], String, String, String&, String&, String, String, IEnumerable 1)(在C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs :121)    UnityEditorInternal.IL2CPPBuilder:RunAssemblyStripper(IEnumerable,String,String [],String [],String)(在C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:444)    UnityEditorInternal.IL2CPPBuilder:StripAssemblies(IEnumerable 1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:417) UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:291) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action 1,RuntimeClassRegistry)(在C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211)    UnityEditor.HostView:OnGUI()

误差2:

  

构建播放器时出错:异常:D:\ Program Files(x86)\ Unity \ Editor \ Data \ Tools / UnusedByteCodeStripper2 / UnusedBytecodeStripper2.exe无法正常运行!

误差3:

  

InvalidOperationException:由于对象的当前状态,操作无效    System.Collections.Stack.Peek()(at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections/Stack.cs:321)    UnityEngine.GUILayoutUtility.EndLayoutGroup()(在C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:278)    UnityEngine.GUILayout.EndScrollView(Boolean handleScrollWheel)(在C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:427)    UnityEditor.EditorGUILayout.EndScrollView()(在C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6808)    UnityEditor.ListViewShared + ListViewElementsEnumerator.MoveNext()(在C:/buildslave/unity/build/Editor/Mono/GUI/ListViewShared.cs:654)    UnityEditor.ConsoleWindow.OnGUI()(在C:/buildslave/unity/build/Editor/Mono/ConsoleWindow.cs:407)    System.Reflection.MonoMethod.Invoke(System.Object obj,BindingFlags invokeAttr,System.Reflection.Binder binder,System.Object [] parameters,System.Globalization.CultureInfo culture)(at / Users / builduser / buildslave / mono-runtime-和-classlibs /建造/ MCS /类/ corlib /的System.Reflection / MonoMethod.cs:222)

1 个答案:

答案 0 :(得分:0)

看起来这里的实际错误信息是:

Failed to resolve System.Web.AspNetHostingPermissionLevel

此类型位于System.dll程序集中(根据MSDN)。 Unity引用System.dll程序集,因此它应该能够找到此程序集。但是,Unity可以针对不同的.NET配置文件。

选择文件&gt;查找当前的个人资料设置。从菜单中构建设置,然后选择播放器设置按钮。您应该在检查器中看到类似的内容:

enter image description here

确保您在此处使用“.NET 2.0”选项,而不是“.NET 2.0 Subset”选项。 .NET 2.0子集配置文件中不存在类型System.Web.AspNetHostingPermissionLevel

项目中的某些预构建程序集可能是针对.NET 2.0配置文件构建的,因此它尝试使用此类型。