5

The game on Unity works but when I export it to Android it stops working. When I do build and run in the terminal it gives me the following error:

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
8
  • Do you have latest operating system for Android? I check for similar issues and found one for early 2019 so I suspect you may have old version of Android. Commented Oct 30, 2020 at 13:23
  • @jdweng Yes the Android system is updated to the latest version, and the unity version is also updated (2020.1.0f1). The game in question is EndlessRunner, it is an open-source game made by unity. Here is the link if you want to check it out: github.com/Unity-Technologies/EndlessRunnerSampleGame Commented Oct 30, 2020 at 14:41
  • Android runs on top of the phone/device kernel and kernel may be old. Commented Oct 30, 2020 at 14:49
  • Possible that this is related to Assembly stripping? E.g. you are using something via a dynamic type that isn't known on compile time yet? Commented Oct 30, 2020 at 15:40
  • @derHugo no I don't use any dynamic typing Commented Oct 30, 2020 at 16:48

2 Answers 2

7

Its all about code stripping. If you want fast resolution, you can create link.xml file in Assets folder with next content:

<linker>
    <assembly fullname="Unity.ResourceManager" preserve="all" />
    <assembly fullname="Unity.Addressables" preserve="all" />
</linker>

If you don't use Addressables, next code:

<linker>
    <assembly fullname="Unity.ResourceManager" preserve="all" />
</linker>

Also you can do more strict code stripping rules. More information about code stripping you can find by this link.

Sign up to request clarification or add additional context in comments.

Comments

0

If you are finding that the Localization package is not working in the build please try the following:

  1. Update to the latest Unity patch version
  2. Update to the latest Addressable Assets package in the package manager.
  3. Try disabling code stripping
  4. Clean and Rebuild Addressables. When Building make sure the Editor is set to the target platform in the Build Settings window.
  5. Try running the Localization Analyzers (0.11.0-preview). This can be found in the Addressables window. Link

Reference

https://forum.unity.com/threads/troubleshooting-addressables-issues.1060346/

1:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.