Search Unity

Android Dev error Chunk buffer must be 16 byte aligned

Discussion in 'Entity Component System' started by echeg, Apr 19, 2019.

  1. echeg

    echeg

    Joined:
    Aug 1, 2012
    Posts:
    90
    When I build not development build all works fine.
    On develop build ECS complitly die with log.
    Does anyone know what could be the problem?

    Code (CSharp):
    1. 04-19 13:18:56.156: E/Unity(10492): AssertionException: Assertion failure. Value was False
    2. 04-19 13:18:56.156: E/Unity(10492): Expected: True
    3. 04-19 13:18:56.156: E/Unity(10492): Chunk buffer must be 16 byte aligned
    4. 04-19 13:18:56.156: E/Unity(10492):   at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x0003c] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBase.cs:29
    5. 04-19 13:18:56.156: E/Unity(10492):   at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x0000e] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBool.cs:20
    6. 04-19 13:18:56.156: E/Unity(10492):   at Unity.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00008] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unity.Entities\Stubs\Unity.Assertions\Assert.cs:24
    7. 04-19 13:18:56.156: E/Unity(10492):   at Unity.Entities.ArchetypeManager..ctor (Unity.Entities.SharedComponentDataManager sharedComponentManager, Unity.Entities.EntityDataManager* entityDataManager, Unity.Entities.EntityGroupManager groupManager) [0x00092] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unit
    8. 04-19 13:18:56.406: I/Unity(10492): Added pool 'Spells'
    9. 04-19 13:18:56.406: I/Unity(10492):  #0 0x9e76bd92 (libunity.so) GetStacktrace(int) 0x25
    10. 04-19 13:18:56.406: I/Unity(10492):  #1 0x9f196244 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x187
    11. 04-19 13:18:56.406: I/Unity(10492):  #2 0x9ecf96b2 (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
    12. 04-19 13:18:56.406: I/Unity(10492):  #3 0x9ecf9602 (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5
    13. 04-19 13:18:56.406: I/Unity(10492):
    14. 04-19 13:18:56.406: I/Unity(10492): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    15. 04-19 13:18:56.731: I/Unity(10492): Added pool 'Units'
    16. 04-19 13:18:56.731: I/Unity(10492):  #0 0x9e76bd92 (libunity.so) GetStacktrace(int) 0x25
    17. 04-19 13:18:56.731: I/Unity(10492):  #1 0x9f196244 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x187
    18. 04-19 13:18:56.731: I/Unity(10492):  #2 0x9ecf96b2 (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
    19. 04-19 13:18:56.731: I/Unity(10492):  #3 0x9ecf9602 (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5
    20. 04-19 13:18:56.731: I/Unity(10492):
    21. 04-19 13:18:56.731: I/Unity(10492): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    22. 04-19 13:18:56.771: I/Unity(10492): LoadWindows
    23. 04-19 13:18:56.771: I/Unity(10492):  #0 0x9e76bd92 (libunity.so) GetStacktrace(int) 0x25
    24. 04-19 13:18:56.771: I/Unity(10492):  #1 0x9f196244 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x187
    25. 04-19 13:18:56.771: I/Unity(10492):  #2 0x9ecf96b2 (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
    26. 04-19 13:18:56.771: I/Unity(10492):  #3 0x9ecf9602 (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5
    27. 04-19 13:18:56.771: I/Unity(10492):
    28. 04-19 13:18:56.771: I/Unity(10492): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    29. 04-19 13:18:58.111: I/Unity(10492): ArrangeWindowsPositions
    30. 04-19 13:18:58.111: I/Unity(10492):  #0 0x9e76bd92 (libunity.so) GetStacktrace(int) 0x25
    31. 04-19 13:18:58.111: I/Unity(10492):  #1 0x9f196244 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x187
    32. 04-19 13:18:58.111: I/Unity(10492):  #2 0x9ecf96b2 (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
    33. 04-19 13:18:58.111: I/Unity(10492):  #3 0x9ecf9602 (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5
    34. 04-19 13:18:58.111: I/Unity(10492):
    35. 04-19 13:18:58.111: I/Unity(10492): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    36. 04-19 13:18:58.471: D/Unity(10492): Uploading Crash Report
    37. 04-19 13:18:58.471: E/Unity(10492): AssertionException: Assertion failure. Value was False
    38. 04-19 13:18:58.471: E/Unity(10492): Expected: True
    39. 04-19 13:18:58.471: E/Unity(10492): Chunk buffer must be 16 byte aligned
    40. 04-19 13:18:58.471: E/Unity(10492):   at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x0003c] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBase.cs:29
    41. 04-19 13:18:58.471: E/Unity(10492):   at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x0000e] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBool.cs:20
    42. 04-19 13:18:58.471: E/Unity(10492):   at Unity.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00008] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unity.Entities\Stubs\Unity.Assertions\Assert.cs:24
    43. 04-19 13:18:58.471: E/Unity(10492):   at Unity.Entities.ArchetypeManager..ctor (Unity.Entities.SharedComponentDataManager sharedComponentManager, Unity.Entities.EntityDataManager* entityDataManager, Unity.Entities.EntityGroupManager groupManager) [0x00092] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unit
    44. 04-19 13:18:58.976: E/Unity(10492): AssertionException: Assertion failure. Value was False
    45. 04-19 13:18:58.976: E/Unity(10492): Expected: True
    46. 04-19 13:18:58.976: E/Unity(10492): Chunk buffer must be 16 byte aligned
    47. 04-19 13:18:58.976: E/Unity(10492):   at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x0003c] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBase.cs:29
    48. 04-19 13:18:58.976: E/Unity(10492):   at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x0000e] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBool.cs:20
    49. 04-19 13:18:58.976: E/Unity(10492):   at Unity.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00008] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unity.Entities\Stubs\Unity.Assertions\Assert.cs:24
    50. 04-19 13:18:58.976: E/Unity(10492):   at Unity.Entities.ArchetypeManager..ctor (Unity.Entities.SharedComponentDataManager sharedComponentManager, Unity.Entities.EntityDataManager* entityDataManager, Unity.Entities.EntityGroupManager groupManager) [0x00092] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unit
    51. 04-19 13:18:59.001: E/Unity(10492): AssertionException: Assertion failure. Value was False
    52. 04-19 13:18:59.001: E/Unity(10492): Expected: True
    53. 04-19 13:18:59.001: E/Unity(10492): Chunk buffer must be 16 byte aligned
    54. 04-19 13:18:59.001: E/Unity(10492):   at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x0003c] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBase.cs:29
    55. 04-19 13:18:59.001: E/Unity(10492):   at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x0000e] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBool.cs:20
    56. 04-19 13:18:59.001: E/Unity(10492):   at Unity.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00008] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unity.Entities\Stubs\Unity.Assertions\Assert.cs:24
    57. 04-19 13:18:59.001: E/Unity(10492):   at Unity.Entities.ArchetypeManager..ctor (Unity.Entities.SharedComponentDataManager sharedComponentManager, Unity.Entities.EntityDataManager* entityDataManager, Unity.Entities.EntityGroupManager groupManager) [0x00092] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unit
    58. 04-19 13:18:59.046: E/Unity(10492): AssertionException: Assertion failure. Value was False
    59. 04-19 13:18:59.046: E/Unity(10492): Expected: True
    60. 04-19 13:18:59.046: E/Unity(10492): Chunk buffer must be 16 byte aligned
    61. 04-19 13:18:59.046: E/Unity(10492):   at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x0003c] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBase.cs:29
    62. 04-19 13:18:59.046: E/Unity(10492):   at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x0000e] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBool.cs:20
    63. 04-19 13:18:59.046: E/Unity(10492):   at Unity.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00008] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unity.Entities\Stubs\Unity.Assertions\Assert.cs:24
    64. 04-19 13:18:59.046: E/Unity(10492):   at Unity.Entities.ArchetypeManager..ctor (Unity.Entities.SharedComponentDataManager sharedComponentManager, Unity.Entities.EntityDataManager* entityDataManager, Unity.Entities.EntityGroupManager groupManager) [0x00092] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unit
    65. 04-19 13:18:59.061: I/Unity(10492): Try Open Window PreGame
    66. 04-19 13:18:59.061: I/Unity(10492):  #0 0x9e76bd92 (libunity.so) GetStacktrace(int) 0x25
    67. 04-19 13:18:59.061: I/Unity(10492):  #1 0x9f196244 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x187
    68. 04-19 13:18:59.061: I/Unity(10492):  #2 0x9ecf96b2 (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
    69. 04-19 13:18:59.061: I/Unity(10492):  #3 0x9ecf9602 (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5
    70. 04-19 13:18:59.061: I/Unity(10492):
    71. 04-19 13:18:59.061: I/Unity(10492): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    72. 04-19 13:18:59.076: I/Unity(10492): PostOpen PreGame
    73. 04-19 13:18:59.076: I/Unity(10492):  #0 0x9e76bd92 (libunity.so) GetStacktrace(int) 0x25
    74. 04-19 13:18:59.076: I/Unity(10492):  #1 0x9f196244 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x187
    75. 04-19 13:18:59.076: I/Unity(10492):  #2 0x9ecf96b2 (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
    76. 04-19 13:18:59.076: I/Unity(10492):  #3 0x9ecf9602 (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5
    77. 04-19 13:18:59.076: I/Unity(10492):
    78. 04-19 13:18:59.076: I/Unity(10492): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    79. 04-19 13:18:59.111: D/Unity(10492): Unloading 26 Unused Serialized files (Serialized files now loaded: 0)
    80. 04-19 13:18:59.151: D/Unity(10492): System memory in use before: 80.3 MB.
    81. 04-19 13:18:59.401: D/Unity(10492): System memory in use after: 80.5 MB.
    82. 04-19 13:18:59.401: D/Unity(10492): Unloading 3 unused Assets to reduce memory usage. Loaded Objects now: 16405.
    83. 04-19 13:18:59.401: D/Unity(10492): Total: 253.669500 ms (FindLiveObjects: 3.916667 ms CreateObjectMapping: 1.399666 ms MarkObjects: 248.218667 ms  DeleteObjects: 0.123834 ms)
    84. 04-19 13:18:59.441: D/Unity(10492): Sensor :        Accelerometer ( 1) ; 0.001197 / 0.00s ; ICM20610 Acceleration Sensor / Invensense
    85. 04-19 13:18:59.446: D/Unity(10492): Choreographer available: Enabling VSYNC timing
    86. 04-19 13:18:59.676: D/Unity(10492): Uploading Crash Report
    87. 04-19 13:18:59.676: E/Unity(10492): AssertionException: Assertion failure. Value was False
    88. 04-19 13:18:59.676: E/Unity(10492): Expected: True
    89. 04-19 13:18:59.676: E/Unity(10492): Chunk buffer must be 16 byte aligned
    90. 04-19 13:18:59.676: E/Unity(10492):   at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x0003c] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBase.cs:29
    91. 04-19 13:18:59.676: E/Unity(10492):   at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x0000e] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBool.cs:20
    92. 04-19 13:18:59.676: E/Unity(10492):   at Unity.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00008] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unity.Entities\Stubs\Unity.Assertions\Assert.cs:24
    93. 04-19 13:18:59.676: E/Unity(10492):   at Unity.Entities.ArchetypeManager..ctor (Unity.Entities.SharedComponentDataManager sharedComponentManager, Unity.Entities.EntityDataManager* entityDataManager, Unity.Entities.EntityGroupManager groupManager) [0x00092] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unit
    94. 04-19 13:18:59.696: D/Unity(10492): Uploading Crash Report
    95. 04-19 13:18:59.696: E/Unity(10492): AssertionException: Assertion failure. Value was False
    96. 04-19 13:18:59.696: E/Unity(10492): Expected: True
    97. 04-19 13:18:59.696: E/Unity(10492): Chunk buffer must be 16 byte aligned
    98. 04-19 13:18:59.696: E/Unity(10492):   at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x0003c] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBase.cs:29
    99. 04-19 13:18:59.696: E/Unity(10492):   at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x0000e] in /Users/builduser/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBool.cs:20
    100. 04-19 13:18:59.696: E/Unity(10492):   at Unity.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x00008] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unity.Entities\Stubs\Unity.Assertions\Assert.cs:24
    101. 04-19 13:18:59.696: E/Unity(10492):   at Unity.Entities.ArchetypeManager..ctor (Unity.Entities.SharedComponentDataManager sharedComponentManager, Unity.Entities.EntityDataManager* entityDataManager, Unity.Entities.EntityGroupManager groupManager) [0x00092] in C:\Repos\awars\Library\PackageCache\com.unity.entities@0.0.12-preview.29\Unit
    102. 04-19 13:19:29.861: I/Unity(10492): onPause
    103. 04-19 13:19:29.871: D/Unity(10492): Uploading Crash Report
    104.  
     
  2. schneckerstein

    schneckerstein

    Joined:
    Dec 6, 2018
    Posts:
    36
    I had the same problem and it was cause by having a bool inside a IComponentData. Replaced it with a int and everything was fine. Only a workarround thought.
     
  3. echeg

    echeg

    Joined:
    Aug 1, 2012
    Posts:
    90
    I think we dont have components with bool. In edtor all work fine.
    Problem only on Android dev builds tested on 6 devices.
     
  4. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    What version of entities are you on?
    I think there's possibly a few causes for this.

    Same problem here refers to missing link.xml

    In my case, this was due to misaligned offsets in the chunk struct on Android but that has been fixed in latest entities by using explicit layout.
     
  5. echeg

    echeg

    Joined:
    Aug 1, 2012
    Posts:
    90
    Link to link.xml is broken. May you provide this file?
    I have this problem on 28,29,30
     
  6. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    Having the same issue here, even after adding the link-file.

    Code (CSharp):
    1. Assertion failed: Chunk buffer must be 16 byte aligned
    2. Assertion failure. Value was False
    3. Expected: True
    4. UnityEngine.Assertions.Assert:Fail(String, String)
    5. Unity.Entities.ArchetypeManager:.ctor(SharedComponentDataManager, EntityDataManager*, EntityGroupManager)
    6. Unity.Entities.EntityManager:OnCreateManager()

    My link-File:

    Code (CSharp):
    1. <linker>
    2.         <assembly fullname="Unity.Entities" preserve="all"/>
    3.         <assembly fullname="Unity.Collections" preserve="all"/>
    4.         <assembly fullname="Unity.Burst" preserve="all"/>
    5.         <assembly fullname="Unity.Entities.Hybrid" preserve="all"/>
    6.         <assembly fullname="Unity.Transforms" preserve="all"/>
    7.         <assembly fullname="Unity.Transforms.Hybrid" preserve="all"/>
    8.         <assembly fullname="Unity.Rendering.Hybrid" preserve="all"/>
    9.         <assembly fullname="Unity.Scenes.Hybrid" preserve="all"/>
    10. </linker>
     
  7. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    This assertion error is from versions prior to .30 where it was possible for Buffer to be non aligned with 16 bytes.
    Try updating to version .30. The Buffer there is fixed at offset 48 and byte alignment is fixed at 16 bytes so I'm not even sure how this assertion can be hit in latest version.

    I don't know what's meant to go in the link.xml file as I haven't used it, just that it solved this same issue for another poster.
    Try copying one directly from the Unity samples.
     
  8. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    version 30 is not available for Unity 2018, and updating to 2019 (i.e. re-writing a S***ton of code) isn't really an option for me, especially as I'm looking to get 2018 LTS-support when the app launches.

    The link.xml just prevents stripping of specific code (see also the issue I was having here: https://forum.unity.com/threads/apps-crashing-on-boot-when-built-with-il2cpp.664360/ ).
    ArchetypeManager is not being stripped (as the Constructor is clearly being executed.)

    The assertion that's failing is in this code (inside the ArchetypeManager.ctor()):

    Code (CSharp):
    1. #if UNITY_ASSERTIONS
    2.             // Buffer should be 16 byte aligned to ensure component data layout itself can gurantee being aligned
    3.             var offset = UnsafeUtility.GetFieldOffset(typeof(Chunk).GetField("Buffer"));
    4.             Assert.IsTrue(offset % 16 == 0, "Chunk buffer must be 16 byte aligned");
    5. #endif
    I'm going to check if Chunk is being stripped somehow next..

    Edit: Chunk is in the same file as the ArcheTypeManager, so it's not being stripped either.
     
  9. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    Is this just temporary or is ecs not going to be supported in 2018? If so then at some point you're going to have to upgrade anyway. I imagine ecs is going to go through many more changes before coming out of preview.
    Yes, I don't know how this stripping happens and how this particular assertion could be hit if Chunk wasn't part of the build.
    If you look at the Chunk struct, you'll see a UNITY_32 define which determines the offset of Buffer and that is what was causing the assertion error in my case as that define wasn't being set in my Android build. I had to manually set that define but version .30 has since fixed that.
    Perhaps wherever that define is set is getting stripped from the build.

    Have you tried building with mono instead and see if that works? It's my limited understanding that link.xml is only needed for IL2CPP cos stripping doesn't occur with mono.
     
  10. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    Yeah, mono is running fine. It's definitely the bytecode stripping that's the issue..
    However, it's probably a much larger issue, as straight up removing the assertion code still doesn't get my app to boot (fully), but just removes the error that it's logging.

    I'm gonna try to make a build with pretty much every assemblydef etc. that I have in my project inside of my link.xml (thereby effectively disabling stripping), and/or see how much of it I can replicate outside of my own project, and make a bugreport (without any of my company's IP).


    Edit: Not sure if .30 is explicitely coming to 2018 at some point, but I'm pretty sure they stated that they wanted to have at least a base version of ECS working in 2018.3 onward (by backporting from 2019).
    2019 LTS is still a ways off though, so not really an option for companies publishing games built on Unity, and IL2CPP is the only available backend for IOS, so Mono isn't an option there either.
     
    Last edited: Apr 19, 2019
  11. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    Here is the link.xml file from the .29 samples
     
    echeg likes this.
  12. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    Unfortunately even using that link.xml AND including ALL assembly defs in my project into it still doesn't seem to fix the issue..
    Guess I'll have to talk my boss into switching to 2019.1 on Tuesday..
     
  13. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    One other thing you could try is see if you can deploy any of the ecs sample projects to Android.
    If they work, which they did for the other poster with this same problem, it might help you pinpoint what's different between the sample and your project. Maybe something in the project or player settings.
     
  14. echeg

    echeg

    Joined:
    Aug 1, 2012
    Posts:
    90
    This work for me (ecs .30)
     
  15. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    Update: Switching to Unity 2019.1 with Entities 0.30 fixed the issue for me wrt IL2CPP (as far as I can tell. Haven't run full tests yet, but at least it's running on Android w/ IL2CPP)
     
  16. jeff-renderheads

    jeff-renderheads

    Joined:
    Oct 4, 2016
    Posts:
    2
    I ended up commenting out the assert that was failing. For some reason, it was causing the app the crash, where without the assert the game worked fine. (which is weird). You can also try building your game in NOT development mode and it should strip out the asserts.

    ArchetypeManager.cs in the packages folder. line 585
    Code (CSharp):
    1. Assert.IsTrue(offset % 16 == 0, "Chunk buffer must be 16 byte aligned");
     
  17. BrendonSmuts

    BrendonSmuts

    Joined:
    Jun 12, 2017
    Posts:
    86
    Errrrr that doesn’t seem like a good idea. The assert is there for a reason. There’s a good chance that burst may optimise certain code to use some SIMD. Certain instructions require data be aligned on larger than regular boundaries, i.e. 16 bytes. Badly aligned data means undefined behaviour which can cause all sorts of very difficult to debug issues such as seemingly random segmentation faults.

    That assert is crashing the app because that check is failing. Commenting this out may work fine on your device but cause terrible behaviour for who knows whatever other devices are out there.