Unity iOS 构建错误 UnusedBytecodeStripper2.exe 没有 运行 正确
Unity iOS Build Error UnusedBytecodeStripper2.exe did not run properly
我在为 iOS 构建应用程序时遇到此错误。脚本后端设置为 IL2CPP,架构是通用的。我知道我项目中的一个插件使用了 zxing 库,这导致了这个错误。当我为 android 构建但无法获得 ios 构建时,我没有收到任何错误。除了删除插件还有其他构建方法吗?
Failed running C:\Program Files\Unity\Editor\Data\Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed" -l none -c link -x "C:\Program Files\Unity\Editor\Data\Tools\native_link.xml" -f "C:\Program Files\Unity\Editor\Data\il2cpp\LinkerDescriptors" -x "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed..\platform_native_link.xml" -x "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -d "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Assembly-UnityScript.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\cscanner.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Google.ProtocolBuffers.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Google.ProtocolBuffers.Serialization.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\NativeToolkitWP8.dll"
stdout:
Fatal error in Mono CIL Linker
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'zxing.unity, Version=0.12.0.0, Culture=neutral, PublicKeyToken=null'
at Mono.Linker.LinkContext.Resolve (IMetadataScope scope) [0x00000] in :0
at Mono.Linker.Steps.ResolveFromXmlStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly, Mono.Linker.LinkContext context) [0x00000] in :0
at Mono.Linker.Steps.ResolveFromXmlStep.GetAssembly (Mono.Linker.LinkContext context, System.String assemblyName) [0x00000] in :0
at Mono.Linker.Steps.ResolveFromXmlStep.ProcessAssemblies (Mono.Linker.LinkContext context, System.Xml.XPath.XPathNodeIterator iterator) [0x00000] in :0
at Mono.Linker.Steps.ResolveFromXmlStep.Process () [0x00000] in :0
at Mono.Linker.Steps.BaseStep.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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:66)
UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable1, 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) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:185)
UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable1) (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) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:121)
UnityEditorInternal.IL2CPPBuilder:RunAssemblyStripper(IEnumerable, String, String[], String[], String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:477)
UnityEditorInternal.IL2CPPBuilder:StripAssemblies(String[], String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:465)
UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:293)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211)
UnityEditor.HostView:OnGUI()
项目中是否有zxing.unity.dll文件?看起来该程序集丢失了。我怀疑项目中有一个引用该程序集的 link.xml 文件。如果您删除那个 link.xml 文件,事情可能会奏效。
请注意,这可能适用于 Android/Mono,因为默认情况下未启用托管代码剥离,因此项目中的 link.xml 文件将被忽略。
作为参考,Unity link.xml 文件有更多详细信息 here。
我在为 iOS 构建应用程序时遇到此错误。脚本后端设置为 IL2CPP,架构是通用的。我知道我项目中的一个插件使用了 zxing 库,这导致了这个错误。当我为 android 构建但无法获得 ios 构建时,我没有收到任何错误。除了删除插件还有其他构建方法吗?
Failed running C:\Program Files\Unity\Editor\Data\Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed" -l none -c link -x "C:\Program Files\Unity\Editor\Data\Tools\native_link.xml" -f "C:\Program Files\Unity\Editor\Data\il2cpp\LinkerDescriptors" -x "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed..\platform_native_link.xml" -x "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -d "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Assembly-UnityScript.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\cscanner.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Google.ProtocolBuffers.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\Google.ProtocolBuffers.Serialization.dll" -a "C:\Users\Koray\Source\Repos\NewJoyiOS\NewJoyiOS\Temp\StagingArea\Data\Managed\NativeToolkitWP8.dll"
stdout: Fatal error in Mono CIL Linker Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'zxing.unity, Version=0.12.0.0, Culture=neutral, PublicKeyToken=null' at Mono.Linker.LinkContext.Resolve (IMetadataScope scope) [0x00000] in :0 at Mono.Linker.Steps.ResolveFromXmlStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly, Mono.Linker.LinkContext context) [0x00000] in :0 at Mono.Linker.Steps.ResolveFromXmlStep.GetAssembly (Mono.Linker.LinkContext context, System.String assemblyName) [0x00000] in :0 at Mono.Linker.Steps.ResolveFromXmlStep.ProcessAssemblies (Mono.Linker.LinkContext context, System.Xml.XPath.XPathNodeIterator iterator) [0x00000] in :0 at Mono.Linker.Steps.ResolveFromXmlStep.Process () [0x00000] in :0 at Mono.Linker.Steps.BaseStep.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 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) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:185) UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable1) (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) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:121) UnityEditorInternal.IL2CPPBuilder:RunAssemblyStripper(IEnumerable, String, String[], String[], String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:477) UnityEditorInternal.IL2CPPBuilder:StripAssemblies(String[], String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:465) UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:293) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211) UnityEditor.HostView:OnGUI()
项目中是否有zxing.unity.dll文件?看起来该程序集丢失了。我怀疑项目中有一个引用该程序集的 link.xml 文件。如果您删除那个 link.xml 文件,事情可能会奏效。
请注意,这可能适用于 Android/Mono,因为默认情况下未启用托管代码剥离,因此项目中的 link.xml 文件将被忽略。
作为参考,Unity link.xml 文件有更多详细信息 here。