Search Unity

Resolved Platforms Android: Building with IL2CPP results in OutOfMemoryError

Discussion in 'Entity Component System' started by Samsle, Jul 25, 2021.

  1. Samsle

    Samsle

    Joined:
    Mar 31, 2020
    Posts:
    110
    Hey,
    building & running my game with Mono works fine, using Platforms Android. But for GooglePlayStore I need a 64bit version, so I had to go with IL2CPP.

    Building with a "Release" Configuration works, but as soon as I run it on android, it throws an error
    "Unknown Type:`Unity.Entities.LinkedEntityGroup` All ComponentType must be known at compile time."
    Code (CSharp):
    1. 2021-07-24 16:08:05.380 3708-4524/? E/Unity: NotSupportedException: System.Web.UI.WebResourceAttribute::set_CdnSupportsSecureConnection
    2.       at System.Web.UI.WebResourceAttribute.set_CdnSupportsSecureConnection (System.Boolean value) [0x00000] in <00000000000000000000000000000000>:0
    3.       at System.MonoCustomAttrs.GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean pseudoAttrs) [0x00000] in <00000000000000000000000000000000>:0
    4.       at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00000] in <00000000000000000000000000000000>:0
    5.       at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00000] in <00000000000000000000000000000000>:0
    6.       at System.Reflection.Assembly.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x00000] in <00000000000000000000000000000000>:0
    7.       at System.
    8. 2021-07-24 16:08:05.537 3708-4524/? E/Unity: ArgumentException: Unknown Type:`Unity.Entities.LinkedEntityGroup` All ComponentType must be known at compile time. For generic components, each concrete type must be registered with [RegisterGenericComponentType].
    9.       at Unity.Entities.TypeManager.ManagedException (System.Type type) [0x00000] in <00000000000000000000000000000000>:0
    10.       at Unity.Entities.TypeManager.ManagedException[T] () [0x00000] in <00000000000000000000000000000000>:0
    11.       at Unity.Entities.TypeManager.GetTypeIndex[T] () [0x00000] in <00000000000000000000000000000000>:0
    12.       at Unity.Entities.EntityComponentStore.Create (Unity.Entities.EntityComponentStore* entities, System.UInt64 startChunkSequenceNumber, System.Int32 newCapacity) [0x00000] in <00000000000000000000000000000000>:0
    13.       at Unity.Entities.EntityDataAccess.Initialize (Unity.Entities.EntityDataAccess* self, Unity.Entities.World world) [0x00000] in <00000000000000000000000000000000>:0
    14.       at Unity.Entities.EntityManager.Initialize (Unity.Entities.World world) [0x00000] in <0000000000000

    Since this error message didn't helped me a lot, I decided to build a "Debug" Configuration build to get more information what failed, but I can't even build it:
    "Execution failed for task ':launcher: PackageDebug'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade.
    > java.lang.OutOfMemoryError (no error message)
    "
    Code (CSharp):
    1. Build AndroidClassicBuildConfiguration failed after 19.29m.
    2. Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details
    3. > Configure project :launcher
    4. WARNING: The option 'android.enableR8' is deprecated and should not be used anymore.
    5. It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
    6. > Task :launcher:preBuild UP-TO-DATE
    7. > Task :launcher:preDebugBuild UP-TO-DATE
    8. > Task :unityLibrary:preBuild UP-TO-DATE
    9. > Task :unityLibrary:preDebugBuild UP-TO-DATE
    10. > Task :unityLibrary:GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE
    11. > Task :unityLibrary:GooglePlayGamesManifest.plugin:preDebugBuild UP-TO-DATE
    12. > Task :unityLibrary:GooglePlayGamesManifest.plugin:compileDebugAidl NO-SOURCE
    13. > Task :unityLibrary:compileDebugAidl NO-SOURCE
    14. > Task :launcher:compileDebugAidl NO-SOURCE
    15. > Task :unityLibrary:packageDebugRenderscript NO-SOURCE
    16. > Task :launcher:compileDebugRenderscript NO-SOURCE
    17. > Task :launcher:generateDebugBuildConfig
    18. > Task :unityLibrary:GooglePlayGamesManifest.plugin:packageDebugRenderscript NO-SOURCE
    19. > Task :unityLibrary:compileDebugRenderscript NO-SOURCE
    20. > Task :unityLibrary:generateDebugBuildConfig
    21. > Task :unityLibrary:generateDebugResValues
    22. > Task :unityLibrary:generateDebugResources
    23. > Task :unityLibrary:packageDebugResources
    24. > Task :unityLibrary:GooglePlayGamesManifest.plugin:compileDebugRenderscript NO-SOURCE
    25. > Task :unityLibrary:GooglePlayGamesManifest.plugin:generateDebugResValues
    26. > Task :unityLibrary:GooglePlayGamesManifest.plugin:generateDebugResources
    27. > Task :unityLibrary:GooglePlayGamesManifest.plugin:packageDebugResources
    28. > Task :unityLibrary:GooglePlayGamesManifest.plugin:generateDebugBuildConfig
    29. > Task :unityLibrary:parseDebugLocalResources
    30. > Task :launcher:mainApkListPersistenceDebug
    31. > Task :launcher:generateDebugResValues
    32. > Task :launcher:generateDebugResources
    33. > Task :launcher:createDebugCompatibleScreenManifests
    34. > Task :launcher:extractDeepLinksDebug
    35. > Task :unityLibrary:extractDeepLinksDebug
    36. > Task :unityLibrary:GooglePlayGamesManifest.plugin:extractDeepLinksDebug
    37. > Task :unityLibrary:GooglePlayGamesManifest.plugin:javaPreCompileDebug
    38. > Task :launcher:mergeDebugShaders
    39. > Task :launcher:compileDebugShaders
    40. > Task :launcher:generateDebugAssets
    41. > Task :unityLibrary:mergeDebugShaders
    42. > Task :unityLibrary:compileDebugShaders
    43. > Task :unityLibrary:generateDebugAssets
    44. > Task :unityLibrary:packageDebugAssets
    45. > Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeDebugShaders
    46. > Task :unityLibrary:GooglePlayGamesManifest.plugin:compileDebugShaders
    47. > Task :unityLibrary:GooglePlayGamesManifest.plugin:generateDebugAssets
    48. > Task :unityLibrary:GooglePlayGamesManifest.plugin:packageDebugAssets
    49. > Task :launcher:mergeDebugAssets
    50. > Task :launcher:processDebugJavaRes NO-SOURCE
    51. > Task :unityLibrary:processDebugJavaRes NO-SOURCE
    52. > Task :unityLibrary:compileDebugLibraryResources
    53. > Task :unityLibrary:GooglePlayGamesManifest.plugin:processDebugJavaRes NO-SOURCE
    54. > Task :launcher:mergeDebugResources
    55. > Task :launcher:checkDebugDuplicateClasses
    56. > Task :unityLibrary:GooglePlayGamesManifest.plugin:processDebugManifest
    57. > Task :launcher:mergeDebugJniLibFolders
    58. > Task :unityLibrary:BuildIl2CppTask
    59. Building libil2cpp.so with AndroidToolChain
    60.     Output directory: D:\Projects\Unity\my-project\Temp\AndroidClassicBuildConfiguration\gradleOut\unityLibrary\src\main\jniLibs\armeabi-v7a
    61.     Cache directory: D:\Projects\Unity\my-project\Temp\AndroidClassicBuildConfiguration\gradleOut\unityLibrary\build\il2cpp_armeabi-v7a_Debug\il2cpp_cache
    62. > Task :unityLibrary:processDebugManifest
    63. > Task :unityLibrary:GooglePlayGamesManifest.plugin:parseDebugLocalResources
    64. > Task :unityLibrary:GooglePlayGamesManifest.plugin:compileDebugLibraryResources
    65. > Task :unityLibrary:bundleLibResDebug
    66. > Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleLibResDebug
    67. > Task :launcher:desugarDebugFileDependencies
    68. > Task :unityLibrary:BuildIl2CppTask
    69. ObjectFiles: 1169 of which compiled: 1169
    70.     Time Compile: 42488 milliseconds Il2CppInvokerTable.cpp
    71.     Time Compile: 21513 milliseconds Il2CppMetadataUsage.c
    72.     Time Compile: 15038 milliseconds Il2CppCCalculateFieldValues1.cpp
    73.     Time Compile: 15027 milliseconds Unity.Transforms.cpp
    74.     Time Compile: 13085 milliseconds Il2CppCCalculateFieldValues4.cpp
    75.     Time Compile: 12697 milliseconds Generics13.cpp
    76.     Time Compile: 12316 milliseconds Lump_libil2cpp_vm.cpp
    77.     Time Compile: 12022 milliseconds Il2CppTypeDefinitions.c
    78.     Time Compile: 11796 milliseconds Unity.Mathematics.cpp
    79.     Time Compile: 11604 milliseconds Unity.Physics1.cpp
    80. Total compilation time: 247006 milliseconds.
    81. Total link time: 39653 milliseconds.
    82. Cleaned up 0 object files.
    83. Building libil2cpp.so with AndroidToolChain
    84.     Output directory: D:\Projects\Unity\my-project\Temp\AndroidClassicBuildConfiguration\gradleOut\unityLibrary\src\main\jniLibs\arm64-v8a
    85.     Cache directory: D:\Projects\Unity\my-project\Temp\AndroidClassicBuildConfiguration\gradleOut\unityLibrary\build\il2cpp_arm64-v8a_Debug\il2cpp_cache
    86. ObjectFiles: 1169 of which compiled: 1169
    87.     Time Compile: 32366 milliseconds Il2CppInvokerTable.cpp
    88.     Time Compile: 23832 milliseconds Il2CppMetadataUsage.c
    89.     Time Compile: 21052 milliseconds Il2CppCCalculateTypeValues3.cpp
    90.     Time Compile: 14488 milliseconds Generics39.cpp
    91.     Time Compile: 13019 milliseconds Il2CppCCalculateFieldValues5.cpp
    92.     Time Compile: 12968 milliseconds Unity.Transforms.cpp
    93.     Time Compile: 12858 milliseconds Il2CppCCalculateFieldValues4.cpp
    94.     Time Compile: 12855 milliseconds Il2CppCCalculateTypeValues.cpp
    95.     Time Compile: 12689 milliseconds Il2CppTypeDefinitions.c
    96.     Time Compile: 12483 milliseconds Il2CppCCalculateFieldValues3.cpp
    97. Total compilation time: 225947 milliseconds.
    98. Total link time: 67736 milliseconds.
    99. Cleaned up 0 object files.
    100. > Task :unityLibrary:mergeDebugJniLibFolders
    101. > Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeDebugJniLibFolders
    102. > Task :launcher:validateSigningDebug
    103. > Task :unityLibrary:GooglePlayGamesManifest.plugin:generateDebugRFile
    104. > Task :unityLibrary:GooglePlayGamesManifest.plugin:compileDebugJavaWithJavac
    105. > Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleLibCompileDebug
    106. > Task :launcher:mergeExtDexDebug
    107. > Task :unityLibrary:GooglePlayGamesManifest.plugin:extractDebugAnnotations
    108. > Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeDebugGeneratedProguardFiles
    109. > Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeDebugConsumerProguardFiles
    110. > Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeDebugNativeLibs
    111. > Task :unityLibrary:GooglePlayGamesManifest.plugin:stripDebugDebugSymbols
    112. > Task :unityLibrary:GooglePlayGamesManifest.plugin:copyDebugJniLibsProjectOnly
    113. > Task :unityLibrary:GooglePlayGamesManifest.plugin:copyDebugJniLibsProjectAndLocalJars
    114. > Task :unityLibrary:prepareLintJarForPublish
    115. > Task :unityLibrary:GooglePlayGamesManifest.plugin:compileDebugSources
    116. > Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleLibRuntimeDebug
    117. > Task :unityLibrary:javaPreCompileDebug
    118. > Task :unityLibrary:GooglePlayGamesManifest.plugin:prepareLintJarForPublish
    119. > Task :unityLibrary:mergeDebugNativeLibs
    120. > Task :unityLibrary:stripDebugDebugSymbols
    121. > Task :unityLibrary:copyDebugJniLibsProjectOnly
    122. > Task :unityLibrary:copyDebugJniLibsProjectAndLocalJars
    123. > Task :launcher:mergeDebugJavaResource
    124. > Task :unityLibrary:mergeDebugJavaResource
    125. > Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeDebugJavaResource
    126. > Task :unityLibrary:GooglePlayGamesManifest.plugin:syncDebugLibJars
    127. > Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleDebugAar
    128. > Task :unityLibrary:GooglePlayGamesManifest.plugin:assembleDebug
    129. > Task :launcher:processDebugManifest
    130. > Task :launcher:mergeDebugNativeLibs
    131. > Task :launcher:stripDebugDebugSymbols
    132. > Task :unityLibrary:generateDebugRFile
    133. > Task :unityLibrary:compileDebugJavaWithJavac
    134. > Task :launcher:processDebugResources
    135. > Task :unityLibrary:extractDebugAnnotations
    136. > Task :unityLibrary:mergeDebugGeneratedProguardFiles
    137. > Task :unityLibrary:mergeDebugConsumerProguardFiles
    138. > Task :unityLibrary:syncDebugLibJars
    139. > Task :unityLibrary:bundleLibCompileDebug
    140. > Task :unityLibrary:bundleLibRuntimeDebug
    141. > Task :unityLibrary:bundleDebugAar
    142. > Task :unityLibrary:compileDebugSources
    143. > Task :unityLibrary:assembleDebug
    144. > Task :launcher:javaPreCompileDebug
    145. > Task :launcher:compileDebugJavaWithJavac
    146. > Task :launcher:compileDebugSources
    147. > Task :launcher:dexBuilderDebug
    148. > Task :launcher:mergeLibDexDebug
    149. > Task :launcher:mergeProjectDexDebug
    150. > Task :launcher:packageDebug FAILED
    151. 82 actionable tasks: 82 executed
    152. Note: D:\Projects\Unity\my-project\Temp\AndroidClassicBuildConfiguration\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
    153. Note: Recompile with -Xlint:deprecation for details.
    154. FAILURE: Build failed with an exception.
    155. * What went wrong:
    156. Execution failed for task ':launcher:packageDebug'.
    157. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    158.    > java.lang.OutOfMemoryError (no error message)
    159. * Try:
    160. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    161. * Get more help at https://help.gradle.org
    162. BUILD FAILED in 11m 23s
    163.  
    164. 0x00007ff78176b2ec (Unity) StackWalker::GetCurrentCallstack
    165. 0x00007ff781771489 (Unity) StackWalker::ShowCallstack
    166. 0x00007ff781f66bb3 (Unity) GetStacktrace
    167. 0x00007ff782e6dc6a (Unity) DebugStringToFile
    168. 0x00007ff7818fd80d (Unity) DebugLogHandler_CUSTOM_Internal_Log
    169. 0x00000295ab25bbbb (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    170. 0x00000295ab25bb0b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    171. 0x00000296a3f3f661 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object,UnityEngine.Object)
    172. 0x00000296a3f4ff2a (Mono JIT Code) UnityEngine.Debug:LogError (object,UnityEngine.Object)
    173. 0x00000296a3f4f52b (Mono JIT Code) [ResultBase.cs:66] Unity.Build.ResultBase:LogResult ()
    174. 0x000002967373f0e3 (Mono JIT Code) [BuildConfigurationInspector.cs:43] Unity.Build.Editor.BuildConfigurationInspector/<>c:<.cctor>b__34_0 (Unity.Build.BuildConfiguration)
    175. 0x000002967373e5fc (Mono JIT Code) [BuildConfigurationInspector.cs:128] Unity.Build.Editor.BuildConfigurationInspector/<>c__DisplayClass30_0:<Build>b__1 ()
    176. 0x00000295b8b5d63f (Mono JIT Code) [Clickable.cs:113] UnityEngine.UIElements.Clickable:Invoke (UnityEngine.UIElements.EventBase)
    177. 0x00000295b8b5d3bb (Mono JIT Code) [Clickable.cs:232] UnityEngine.UIElements.Clickable:ProcessUpEvent (UnityEngine.UIElements.EventBase,UnityEngine.Vector2,int)
    178. 0x00000295b8b5d190 (Mono JIT Code) [Clickable.cs:144] UnityEngine.UIElements.Clickable:OnMouseUp (UnityEngine.UIElements.MouseUpEvent)
    179. 0x00000295a481ac94 (Mono JIT Code) [EventCallback.cs:64] UnityEngine.UIElements.EventCallbackFunctor`1<TEventType_REF>:Invoke (UnityEngine.UIElements.EventBase)
    180. 0x00000295a481aaae (Mono JIT Code) [EventCallbackRegistry.cs:336] UnityEngine.UIElements.EventCallbackRegistry:InvokeCallbacks (UnityEngine.UIElements.EventBase)
    181. 0x00000295a4753bd3 (Mono JIT Code) [EventHandler.cs:149] UnityEngine.UIElements.CallbackEventHandler:HandleEvent (UnityEngine.UIElements.EventBase)
    182. 0x00000295a481bec3 (Mono JIT Code) [TextElement.cs:98] UnityEngine.UIElements.TextElement:HandleEvent (UnityEngine.UIElements.EventBase)
    183. 0x00000295a4753952 (Mono JIT Code) [EventHandler.cs:126] UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase)
    184. 0x00000295a488d853 (Mono JIT Code) [MouseCaptureDispatchingStrategy.cs:87] UnityEngine.UIElements.MouseCaptureDispatchingStrategy:DispatchEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
    185. 0x00000295a475212f (Mono JIT Code) [EventDispatcher.cs:379] UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,bool)
    186. 0x00000295a4751d4b (Mono JIT Code) [EventDispatcher.cs:343] UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
    187. 0x00000295a475692b (Mono JIT Code) [EventDispatcher.cs:303] UnityEngine.UIElements.EventDispatcher:ProcessEventQueue ()
    188. 0x00000295a47555f3 (Mono JIT Code) [EventDispatcher.cs:268] UnityEngine.UIElements.EventDispatcher:OpenGate ()
    189. 0x00000295a475557b (Mono JIT Code) [EventDispatcher.cs:76] UnityEngine.UIElements.EventDispatcherGate:Dispose ()
    190. 0x00000295a4751fb3 (Mono JIT Code) [EventDispatcher.cs:368] UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
    191. 0x00000295a4751913 (Mono JIT Code) [EventDispatcher.cs:219] UnityEngine.UIElements.EventDispatcher:Dispatch (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,UnityEngine.UIElements.DispatchMode)
    192. 0x00000295a47517db (Mono JIT Code) [Panel.cs:399] UnityEngine.UIElements.BaseVisualElementPanel:SendEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.DispatchMode)
    193. 0x00000295dfdfd2eb (Mono JIT Code) [UIElementsUtility.cs:466] UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
    194. 0x00000295dfdfcddb (Mono JIT Code) [UIElementsUtility.cs:209] UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&)
    195. 0x00000295dfdfcbd4 (Mono JIT Code) [UIElementsUtility.cs:74] UnityEngine.UIElements.UIEventRegistration:ProcessEvent (int,intptr)
    196. 0x00000295dfdfcb0b (Mono JIT Code) [UIElementsUtility.cs:28] UnityEngine.UIElements.UIEventRegistration/<>c:<.cctor>b__1_2 (int,intptr)
    197. 0x00000295dfdfc98d (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    198. 0x00000295dfdfca3e (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_intptr_intptr& (object,intptr,intptr,intptr)
    199. 0x00007ff89706e660 (mono-2.0-bdwgc) [mini-runtime.c:2812] mono_jit_runtime_invoke
    200. 0x00007ff896ff2af2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
    201. 0x00007ff896ffbb4f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
    202. 0x00007ff7816b6704 (Unity) scripting_method_invoke
    203. 0x00007ff7816b1d71 (Unity) ScriptingInvocation::Invoke
    204. 0x00007ff7816ac025 (Unity) ScriptingInvocation::Invoke<void>
    205. 0x00007ff78098bd4a (Unity) Scripting::UnityEngine::GUIUtilityProxy::ProcessEvent
    206. 0x00007ff781aa2696 (Unity) GUIView::ProcessRetainedMode
    207. 0x00007ff781f924ad (Unity) GUIView::OnInputEvent
    208. 0x00007ff781aa2582 (Unity) GUIView::ProcessInputEvent
    209. 0x00007ff781f934e9 (Unity) GUIView::ProcessEventMessages
    210. 0x00007ff781f8d5bd (Unity) GUIView::GUIViewWndProc
    211. 0x00007ff8ee54e858 (USER32) CallWindowProcW
    212. 0x00007ff8ee54e299 (USER32) DispatchMessageW
    213. 0x00007ff781f6c796 (Unity) MainMessageLoop
    214. 0x00007ff781f70516 (Unity) WinMain
    215. 0x00007ff783aa2e92 (Unity) __scrt_common_main_seh
    216. 0x00007ff8ee9e7034 (KERNEL32) BaseThreadInitThunk
    217. 0x00007ff8f02a2651 (ntdll) RtlUserThreadStart

    This error message does also not help me really (My Maximum JVM heap size is already set to 30.720 Mbytes).
    It gives me a hint to add arguments --stacktrace, --info or --debug to get more information.
    But I don't know how I can add these arguments.

    I tried to use a custom gradleTemplate.properties and added --stacktrace to org.gradle.jvmargs
    Code (CSharp):
    1. org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M --stacktrace
    2. org.gradle.parallel=true
    3. android.enableR8=**MINIFY_WITH_R_EIGHT**
    4. unityStreamingAssets=.unity3d**STREAMING_ASSETS**
    5. # Android Resolver Properties Start
    6. android.useAndroidX=true
    7. android.enableJetifier=true
    8. # Android Resolver Properties End
    9. **ADDITIONAL_PROPERTIES**
    but it didn't work, still the same error message without further information :(

    PS: Some specs I use:
    • Unity 2021.1.15f1 (switching back to Unity 2020 does not work, because of incompatibility between subscenes and UI Toolkit)
    • Platforms Android 0.10.0-preview.10
    • Entities 0.17.0-preview.41
    • Hybrid Renderer 0.11.0-preview.42
    • Universal RP 11.0.0
    • UI Toolkit 1.0.0-preview.14
    • Unity Netcode 0.6.0-preview.7
    • Unity Physics 0.6.0-preview.3
    • And some dll's, which all are mentioned in some link.xml files, flagged with preserve="all"
     
    Last edited: Oct 20, 2021
  2. Samsle

    Samsle

    Joined:
    Mar 31, 2020
    Posts:
    110
    I tested it with new clean Unity Projects in 2021.1.15f1 and 2021.2.0b4, and as soon as I add an Entity package the IL2CPP debug-build will fail, or the release-build will crash on Android.

    I guess this is one of the outcome of Notice on DOTS compatibility with Unity 2021.1.

    Because with Unity 2020.3.14f1 the build works.
    The only problem I have with this is, that UI Toolkit only works with Dots in Unity 2021.

    So I guess I finally ended up in a deadlock :(
    Though @Endlesser provided a nice work-around for the UI Toolkit problem, maybe that helps. I will give it a try the next days.

    Update: The workaround did not work for me, as soon as I have UI Toolkit in the project it fails again in Unity 2020.3.14f1 with the OutOfMemoryError (and all of this in a new clean project)
     
    Last edited: Jul 28, 2021
  3. alican_hasirci

    alican_hasirci

    Joined:
    Jul 7, 2020
    Posts:
    20
    Hey @Samsle ,
    I know it has been some time since this message, but I wanted to ask, have you got any errors during bootstrapping about scene catalog? I had the same issue with Entities 0.17, downgrading to 0.16 helped me but then I've did the bootstrapping by adding
    UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP
    to scripting symbols and
    Code (CSharp):
    1. public static class CustomBootstrap {
    2.         [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
    3.         private static void Initialize() {
    4. #if UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP
    5.         DefaultWorldInitialization.Initialize("Default World", false);
    6. #endif
    7.         }
    8.     }
    Although I share the same problem with debugging running out of memory :/
     
  4. apkdev

    apkdev

    Joined:
    Dec 12, 2015
    Posts:
    284
    menshikh-ll likes this.