Unity3d iOS il2cpp Mono.Cecil.AssemblyResolutionException 解析程序集失败 System.Threading
Unity3d iOS il2cpp Mono.Cecil.AssemblyResolutionException Failed to resolve assembly System.Threading
Unity3d 4.6.7p2 iOS
il2cpp通用
。网
剥离禁用
我们在构建 iOS 构建时遇到错误。
奇怪的是,这个错误在某个时间点出现在我们办公室的所有计算机上,如果我们切换到 Git 中没有问题的提交,错误就存在。
所以我们认为这个错误与我们的更改无关。
我们尝试切换到旧的提交,重新启动 Unity,清理库文件夹没有任何变化。
什么会导致这样的错误?
Failed running /Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "/PATH/Temp/StagingArea/Data/Managed" -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 "/PATH/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/PATH/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -x "/PATH/Assets/link.xml" -d "/PATH/Temp/StagingArea/Data/Managed" -a "/PATH/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Assembly-UnityScript-firstpass.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll" -a "/PATH/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" -a "/PATH/Temp/StagingArea/Data/Managed/IFacebook.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Glow11.dll" -a "/PATH/Temp/StagingArea/Data/Managed/HOTweenMicro.dll" -a "/PATH/Temp/StagingArea/Data/Managed/ArabicSupport.dll" -a "/PATH/Temp/StagingArea/Data/Managed/DecalSystem.Runtime.dll" -a "/PATH/Temp/StagingArea/Data/Managed/P31RestKit.dll" -a "/PATH/Temp/StagingArea/Data/Managed/P31WinPhoneFlurry.dll" -a "/PATH/Temp/StagingArea/Data/Managed/P31WinPhoneSocialNetworking.dll" -a "/PATH/Temp/StagingArea/Data/Managed/P31WinPhoneStore.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Photon3Unity3D.dll" -a "/PATH/Temp/StagingArea/Data/Managed/OUR_COMPANY.Phone.dll" -a "/PATH/Temp/StagingArea/Data/Managed/TPL.dll" -a "/PATH/Temp/StagingArea/Data/Managed/websocket-sharp.dll"
stdout;
Fatal error in Mono CIL Linker
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Threading, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at Mono.Linker.LinkContext.Resolve (IMetadataScope scope) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.ResolveFromXmlStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly, Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.ResolveFromXmlStep.GetAssembly (Mono.Linker.LinkContext context, System.String assemblyName) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.ResolveFromXmlStep.ProcessAssemblies (Mono.Linker.LinkContext context, System.Xml.XPath.XPathNodeIterator iterator) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.ResolveFromXmlStep.Process () [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.BaseStep.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, String&, String&, String, String)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String, String&, String&, String, String, IEnumerable`1)
UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable`1)
UnityEditorInternal.AssemblyStripper:Strip(String[], String[], String, String, String&, 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.HostView:OnGUI()
link.xml:
<linker>
<assembly fullname="mscorlib">
<namespace fullname="System.Security.Cryptography" preseve="all"/>
</assembly>
我的同事解决了这个问题,方法是用 Parse 库替换 TPL.dll 中的函数,并从项目中删除 TPL.dll。
Unity3d 4.6.7p2 iOS
il2cpp通用
。网
剥离禁用
我们在构建 iOS 构建时遇到错误。
奇怪的是,这个错误在某个时间点出现在我们办公室的所有计算机上,如果我们切换到 Git 中没有问题的提交,错误就存在。
所以我们认为这个错误与我们的更改无关。
我们尝试切换到旧的提交,重新启动 Unity,清理库文件夹没有任何变化。
什么会导致这样的错误?
Failed running /Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "/PATH/Temp/StagingArea/Data/Managed" -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 "/PATH/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/PATH/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -x "/PATH/Assets/link.xml" -d "/PATH/Temp/StagingArea/Data/Managed" -a "/PATH/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Assembly-UnityScript-firstpass.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll" -a "/PATH/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" -a "/PATH/Temp/StagingArea/Data/Managed/IFacebook.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Glow11.dll" -a "/PATH/Temp/StagingArea/Data/Managed/HOTweenMicro.dll" -a "/PATH/Temp/StagingArea/Data/Managed/ArabicSupport.dll" -a "/PATH/Temp/StagingArea/Data/Managed/DecalSystem.Runtime.dll" -a "/PATH/Temp/StagingArea/Data/Managed/P31RestKit.dll" -a "/PATH/Temp/StagingArea/Data/Managed/P31WinPhoneFlurry.dll" -a "/PATH/Temp/StagingArea/Data/Managed/P31WinPhoneSocialNetworking.dll" -a "/PATH/Temp/StagingArea/Data/Managed/P31WinPhoneStore.dll" -a "/PATH/Temp/StagingArea/Data/Managed/Photon3Unity3D.dll" -a "/PATH/Temp/StagingArea/Data/Managed/OUR_COMPANY.Phone.dll" -a "/PATH/Temp/StagingArea/Data/Managed/TPL.dll" -a "/PATH/Temp/StagingArea/Data/Managed/websocket-sharp.dll"
stdout;
Fatal error in Mono CIL Linker
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Threading, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at Mono.Linker.LinkContext.Resolve (IMetadataScope scope) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.ResolveFromXmlStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly, Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.ResolveFromXmlStep.GetAssembly (Mono.Linker.LinkContext context, System.String assemblyName) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.ResolveFromXmlStep.ProcessAssemblies (Mono.Linker.LinkContext context, System.Xml.XPath.XPathNodeIterator iterator) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.ResolveFromXmlStep.Process () [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.BaseStep.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, String&, String&, String, String)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String, String&, String&, String, String, IEnumerable`1)
UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable`1)
UnityEditorInternal.AssemblyStripper:Strip(String[], String[], String, String, String&, 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.HostView:OnGUI()
link.xml:
<linker>
<assembly fullname="mscorlib">
<namespace fullname="System.Security.Cryptography" preseve="all"/>
</assembly>
我的同事解决了这个问题,方法是用 Parse 库替换 TPL.dll 中的函数,并从项目中删除 TPL.dll。