【发布时间】:2021-08-03 12:19:32
【问题描述】:
我有一个移动应用项目,它在 Android 上构建顺利且没有任何错误。但是当我尝试将它构建到 iOS 设备时,我在 Xcode 中收到此错误:
Unable to find internal function `UnityEngine.Jobs.TransformAccess::GetWorldToLocalMatrix`
Unity.Burst.BurstCompilerHelper:IsCompiledByBurst(Delegate)
Unity.Burst.BurstCompilerHelper:.cctor()
Unity.Burst.BurstCompiler:Compile(T, Boolean)
Unity.Entities.ComponentSystemGroup:.cctor()
Unity.Entities.InitializationSystemGroup:.ctor()
System.Reflection.MonoCMethod:InternalInvoke(Object, Object[])
System.Activator:CreateInstance(Type, Boolean)
Unity.Entities.TypeManager:ConstructSystem(Type)
Unity.Entities.World:CreateSystemInternal(Type)
Unity.Entities.World:GetOrCreateSystem()
Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
Unity.Entities.AutomaticWorldBootstrap:Initialize()
Unity将项目构建到Xcode就好了,Xcode似乎也将项目构建到设备上,但是当它在设备上运行时,它会抛出这个错误并崩溃......我试图在上面查找不同的解决方案互联网,我找到了一些链接,但到目前为止这些链接都没有:
https://forum.unity.com/threads/solved-unable-to-find-internal-function.777044/ https://forum.unity.com/threads/unable-to-find-internal-function-with-transport-library-on-ios.731471/
知道什么可能导致此错误吗?顺便说一句,我正在使用 Unity 2020.2.1f1
编辑 |更新 如果我在启用“开发构建”的情况下构建项目,它会在 IL2CPP Android 和 iOS 上正常运行。但是如果我取消选中 Development Build,它会像以前一样在 Android 和 iOS IL2CPP 构建上崩溃。奇怪的。任何可能的信息?在 Android 上的 Mono 上构建相同的项目也很顺利...... 对我来说似乎是代码剥离错误,我尝试了以下解决方案:
- 禁用剥离引擎代码
- 更新作业和 Burst 包
- 启用/禁用 Burst 编译
到目前为止,这些都没有奏效。 :(
我还在 assets 文件夹中添加了一个 link.xml 文件,看起来像这样
<linker>
<assembly fullname="Unity.Collections" preserve="all" />
<assembly fullname="Unity.Collections.Tests" preserve="all" />
<assembly fullname="Unity.Burst.Tests" preserve="all" />
<assembly fullname="Unity.Transforms" preserve="all" />
<assembly fullname="Unity.Transforms.Hybrid" preserve="all" />
<assembly fullname="Unity.Transforms.Tests" preserve="all" />
<assembly fullname="Unity.Jobs" preserve="all" />
<assembly fullname="Unity.Jobs.Tests" preserve="all" />
<assembly fullname="Unity.Burst" preserve="all" />
<assembly fullname="UnityEngine">
<type fullname="UnityEngine.*" preserve="all"/>
<type fullname="UnityEngine.Jobs.*" preserve="all"/>
<type fullname="UnityEngine.Jobs.TransformAccess.*" preserve="all"/>
</assembly>
</linker>
【问题讨论】:
标签: c# android ios xcode unity3d