【发布时间】:2021-09-30 21:46:16
【问题描述】:
Unity 上的游戏可以运行,但是当我将其导出到 Android 时它停止运行。当我在终端中构建和运行时,它给了我以下错误:
2020/10/30 14:09:09.050 20499 20540 Error Unity MissingMethodException: Default constructor not found for type UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
2020/10/30 14:09:09.050 20499 20540 Error Unity at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
2020/10/30 14:09:09.050 20499 20540 Error Unity at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
2020/10/30 14:09:09.050 20499 20540 Error Unity at UnityEngine.ResourceManagement.Util.LRUCacheAllocationStrategy.New (System.Type type, System.Int32 typeHash) [0x00000] in <00000000000000000000000000000000>:0
2020/10/30 14:09:09.050 20499 20540 Error Unity at UnityEngine.ResourceManagement.ResourceManager.CreateOperation[T] (System.Type actualType, System.Int32 typeHash, System.Int32 operationHash, System.Action`1[T] onDestroyAction) [0x00000] in <00000000000000000000000000000000>:0
2020/10/30 14:09:09.050 20499 20540 Error Unity at UnityEngine.ResourceManagement.ResourceManager.ProvideResource (UnityEngine.ResourceM
2020/10/30 14:09:09.057 20499 20540 Error Unity MissingMethodException: Default constructor not found for type UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[[System.Collections.Generic.IList`1[[ThemeData, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
2020/10/30 14:09:09.057 20499 20540 Error Unity at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
2020/10/30 14:09:09.057 20499 20540 Error Unity at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
2020/10/30 14:09:09.057 20499 20540 Error Unity at UnityEngine.ResourceManagement.Util.LRUCacheAllocationStrategy.New (System.Type type, System.Int32 typeHash) [0x00000] in <00000000000000000000000000000000>:0
2020/10/30 14:09:09.057 20499 20540 Error Unity at UnityEngine.ResourceManagement.ResourceManager.CreateOperation[T] (System.Type actualType, System.Int32 typeHash, System.Int32 operationHash, System.Action`1[T] onDestroyAction) [0x00000] in <00000000000000000000000000000000>:0
2020/10/30 14:09:09.057 20499 20540 Error Unity at UnityEngine.ResourceManagement.Res
【问题讨论】:
-
你有最新的安卓操作系统吗?我检查了类似的问题,发现了一个 2019 年初的问题,所以我怀疑您可能使用的是旧版本的 Android。
-
@jdweng 是的Android系统更新到最新版本,unity版本也更新了(2020.1.0f1)。有问题的游戏是EndlessRunner,它是由unity制作的开源游戏。如果您想查看,请点击以下链接:github.com/Unity-Technologies/EndlessRunnerSampleGame
-
Android 运行在手机/设备内核之上,内核可能较旧。
-
这可能与装配剥离有关吗?例如。您正在通过编译时未知的动态类型使用某些东西?
-
@derHugo 不,我不使用任何动态输入