Unity 3d: Error UnusedBytecodeStripper2.exe when buil ios

本文关键字:when buil ios exe UnusedBytecodeStripper2 3d Error Unity | 更新日期: 2023-09-27 18:35:10

我正在尝试制作我的unity 3d游戏来为iOS构建。我将脚本后端设置为 IL2CPP(armv7 和 arm64),但出现以下错误。

运行失败 /applications/unity/unity.app/content/frameworks/tools/unusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed" -l none -c link -x "/Applications/Unity/Unity.app/Content/Frameworks/Tools/UnusedByteCodeStripper/native_link.xml" -f "/Applications/Unity/Unity.app/Content/Frameworks/il2cpp/LinkerDescriptors" -x "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -d "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed" -a "/users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" -a "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll" -a "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" -a "/users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed/LitJson.dll" -a "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed/System.Configuration.dll" -a "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed/System.Data.dll" -a "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed/System.EnterpriseServices.dll" -a "/Users/macbook/Documents/imbatouch/project/ACT/Temp/StagingArea/Data/Managed/System.Security.dll"

标准输出;错误:无法解析基本类型 系统.配置.配置类型异常 System.Configuration.ConfigurationErrorsException Mono 中的致命错误 CIL 链接器系统。异常: 错误: 无法解析基类型 系统.配置.配置类型异常 System.Configuration.ConfigurationErrorsException at UnusedBytecodeStripper2.ResolveFromMonoBehaviors.IsMonoBehaviorOrScriptableObject (Mono.Cecil.TypeDefinition type)[0x00000] in :0
在 System.Linq.Enumerable+c__Iterator35 1[Mono.Cecil.TypeDefinition].MoveNext () [0x00000] in <filename unknown>:0 at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.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 Mono.Linker.Driver.Run () [0x00000] in <filename unknown>:0 at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver) [0x00000] in <filename unknown>:0 stderr: UnityEngine.Debug:LogError(Object) UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable
1, 字符串&, 字符串&, 字符串, 字符串) UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String, 字符串&, 字符串&, 字符串, 字符串, IEnumerable 1) UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable 1) UnityEditorInternal.AssemblyStripper:Strip(String[], String[], String, 字符串, 字符串&, 字符串&, 字符串, 字符串, IEnumerable 1) UnityEditorInternal.IL2CPPBuilder:RunAssemblyStripper(IEnumerable, String, String[], String[], String) UnityEditorInternal.IL2CPPBuilder:StripAssemblies(IEnumerable 1, String) UnityEditorInternal.IL2CPPBuilder:Run() UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action'1, RuntimeClassRegistry) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

Unity 3d: Error UnusedBytecodeStripper2.exe when buil ios

此错误

通常表示用于生成项目的 .NET 配置文件(在 Unity 编辑器播放器设置中称为"API 兼容级别")存在问题。我怀疑项目中有一个程序集,使用与用于构建项目的配置文件不同的配置文件构建。尝试更改"API 兼容级别"设置 - 这可能会更正此问题。