gpt4 book ai didi

ios - 统一 5 和 IL2CPP : cannot build

转载 作者:行者123 更新时间:2023-11-29 10:31:51 24 4
gpt4 key购买 nike

过去几天我一直在绞尽脑汁试图将我的机器人应用程序移植到 iOS。

大部分代码是内部代码,仅使用 UnityAds、SIS(简单 IAP 系统)和 GooglePlayGames 插件。

启用 IL2CCP 后,它甚至不会在 Unity 5(最新版本)上构建。我收到以下错误:

IL2CPP error for type 'GooglePlayGames.Native.PInvoke.PInvokeUtilities/OutStringMethod' in assembly '/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll'
Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.

Failed running /Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/il2cpp.exe --copy-level=None --enable-generic-sharing --enable-unity-event-support --emit-null-checks --enable-array-bounds-check --enable-symbol-loading
"/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll"
"/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll"
"/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll"
"/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" "/Temp/StagingArea/Data/Managed/OpenIAB_W8Plugin.dll" "/Temp/StagingArea/Data/Managed/UnityEngine.Cloud.Analytics.dll"
"/Temp/il2cppOutput/il2cppOutput"

stdout:
IL2CPP error for type 'GooglePlayGames.Native.PInvoke.PInvokeUtilities/OutStringMethod' in assembly '/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll'
Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.
stderr:

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Cannot cast from source type to destination type.
at Unity.IL2CPP.IncludeCollection.NonTemplated.TypeDefinitionVisitor.HandleDelegate (Mono.Cecil.TypeDefinition typeDefinition) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.TypeDefinitionVisitor.Visit (Mono.Cecil.TypeDefinition typeDefinition, Unity.Cecil.Visitor.Context context) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0
at Unity.Cecil.Visitor.Visitor.VisitTypeDefinition [0x00000] in :0
at Unity.Cecil.Visitor.Extensions.DoAcceptTypeDefinition [0x00000] in :0
at Unity.Cecil.Visitor.Extensions.Accept (Mono.Cecil.TypeDefinition typeDefinition, Unity.Cecil.Visitor.Visitor visitor) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.IncludeCollector.ForTypeDefinition (Mono.Cecil.TypeDefinition type) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.IncludeCollector.ForTypeDefinition (Mono.Cecil.TypeReference type) [0x00000] in :0
at Unity.IL2CPP.IncludeWriter.WriteTypeDefinitionIncludes (Mono.Cecil.TypeReference type, Unity.IL2CPP.CppCodeWriter writer) [0x00000] in :0
at Unity.IL2CPP.SourceWriter.WriteTypeDefinitionFor (System.String outputDirectory, Mono.Cecil.TypeReference type) [0x00000] in :0
at Unity.IL2CPP.SourceWriter.Write (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics, System.String outputDir, Mono.Cecil.TypeDefinition[] typeList, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection) [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.Convert (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics) [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.Apply () [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies (System.String[] assemblies, System.String outputDir) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Cannot cast from source type to destination type.
at Unity.IL2CPP.IncludeCollection.NonTemplated.TypeDefinitionVisitor.HandleDelegate (Mono.Cecil.TypeDefinition typeDefinition) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.TypeDefinitionVisitor.Visit (Mono.Cecil.TypeDefinition typeDefinition, Unity.Cecil.Visitor.Context context) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0
at Unity.Cecil.Visitor.Visitor.VisitTypeDefinition [0x00000] in :0
at Unity.Cecil.Visitor.Extensions.DoAcceptTypeDefinition [0x00000] in :0
at Unity.Cecil.Visitor.Extensions.Accept (Mono.Cecil.TypeDefinition typeDefinition, Unity.Cecil.Visitor.Visitor visitor) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.IncludeCollector.ForTypeDefinition (Mono.Cecil.TypeDefinition type) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.IncludeCollector.ForTypeDefinition (Mono.Cecil.TypeReference type) [0x00000] in :0
at Unity.IL2CPP.IncludeWriter.WriteTypeDefinitionIncludes (Mono.Cecil.TypeReference type, Unity.IL2CPP.CppCodeWriter writer) [0x00000] in :0
at Unity.IL2CPP.SourceWriter.WriteTypeDefinitionFor (System.String outputDirectory, Mono.Cecil.TypeReference type) [0x00000] in :0
at Unity.IL2CPP.SourceWriter.Write (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics, System.String outputDir, Mono.Cecil.TypeDefinition[] typeList, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection) [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.Convert (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics) [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.Apply () [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies (System.String[] assemblies, System.String outputDir) [0x00000] in :0

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.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection1, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:404) UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:275) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211)
UnityEditor.HostView:OnGUI()

Exception: /Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/il2cpp.exe did not run properly!
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:68)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (ICollection1 userAssemblies, System.String outputDirectory, System.String workingDirectory) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:404) UnityEditorInternal.IL2CPPBuilder.Run () (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:275) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, System.Action1 modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211)
UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.iOSBuildPostprocessor pp, BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String stagingAreaDataManaged, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
UnityEditor.HostView:OnGUI()

Error building Player: Exception: /Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/il2cpp.exe did not run properly!

最佳答案

看这里: http://forum.unity3d.com/threads/il2cpp-exe-error.311499/

这里: https://github.com/playgameservices/play-games-plugin-for-unity/issues/433

其他人也遇到了问题,特别是 Google 游戏服务插件。我还没有看到解决方案,但是 Unity 链接上的一位 Unity 员工说他会调查一下。

更新:最新的 Unity 补丁 5.0.0p2 为我修复了这个错误: http://unity3d.com/unity/qa/patch-releases

关于ios - 统一 5 和 IL2CPP : cannot build,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29197094/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com