Search Unity

Entities not rendering on mobile

Discussion in 'Graphics for ECS' started by FrankvHoof, Nov 23, 2018.

  1. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    I'm using the Standard Shader (set to Fade).
    In the Editor, all of my entities are working fine.
    However, when I build to Android (or iOS), none of my Entities are being rendered.

    In-Editor: https://gyazo.com/bd72ebddacf1f4b5860de5de669e84f5
    In-Build: https://gyazo.com/5b6c3e721464356b482359c5894dde4b

    Checking adb-Logcat I can see that my bootstrap is running fine, and my Entities are indeed being created.
    I am getting a few errors with regards to UnityEngine.Jobs though:

    Code (Console):
    1. 11-23 10:39:31.297 17144 17160 E Unity   : Unable to find lib_burst_generated[/I][/I][/I]
    2. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : Unable to find internal function `UnityEngine.Jobs.TransformAccessArray::GetSortedToUserIndex`[/I][/I][/I]
    3. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    4. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : (Filename:  Line: 313)[/I][/I][/I]
    5. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    6. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : Unable to find internal function `UnityEngine.Jobs.TransformAccessArray::GetSortedTransformAccess`[/I][/I][/I]
    7. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    8. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : (Filename:  Line: 313)[/I][/I][/I]
    9. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    10. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : Unable to find internal function `UnityEngine.Jobs.TransformAccess::GetRotation`[/I][/I][/I]
    11. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    12. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : (Filename:  Line: 313)[/I][/I][/I]
    13. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    14. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : Unable to find internal function `UnityEngine.Jobs.TransformAccess::GetPosition`[/I][/I][/I]
    15. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    16. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : (Filename:  Line: 313)[/I][/I][/I]
    17. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    18. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : Unable to find internal function `UnityEngine.Jobs.TransformAccess::SetPosition`[/I][/I][/I]
    19. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    20. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   : (Filename:  Line: 313)[/I][/I][/I]
    21. [I][I][I]11-23 10:39:31.298 17144 17160 E Unity   :[/I][/I][/I]
    22. [I][I][I]11-23 10:39:31.299 17144 17160 E Unity   : Unable to find internal function `UnityEngine.Jobs.TransformAccess::SetRotation`[/I][/I][/I]
    23. [I][I][I]11-23 10:39:31.299 17144 17160 E Unity   :[/I][/I][/I]
    24. [I][I][I]11-23 10:39:31.299 17144 17160 E Unity   : (Filename:  Line: 313)


    The logs first made me think that the problem wasn't the rendering, but the positioning of the Entities.
    However, even if I set my camera to look at 0,0,0, and remove all positioning-code, the entities still don't show up.
    (The same errors show up in Logcat, even though I removed all SetComponentData-code for Position & Rotation, and completely commented out my positioningjob)

    In-Editor: https://gyazo.com/471d8a886b05e0c896b0a23e7ddb3c5e
    In-Build (background set to skybox, no other changes): https://gyazo.com/9a8ffe67651df013f46f8b765c3dc832

    As the errors show up even without any of my own code; Is this a bug within Unity's code?
    My renderer-setup:
    https://gyazo.com/e0ebfb1df934717006836d056be0eb77

    Edit: Running on Unity 2018.2.15f1 with:
    Burst 0.2.4-preview.35
    Entities 0.0.12-preview.19
    Jobs 0.0.7-preview.5
    Mathematics 0.0.12-preview.19

    Edit2: Submitted bug report. Case-# 1103423
     
    Last edited: Nov 23, 2018
  2. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    Anyone?
     
  3. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    So... after a LOT of headaches & tests, I figured it out.
    USING IL2CPP AS SCRIPTING BACKEND BREAKS UNITY.TRANSFORMS
    setting it to Mono instead fixes it.
     
    eterlan likes this.
  4. Srokaaa

    Srokaaa

    Joined:
    Sep 18, 2018
    Posts:
    169
  5. drhodor

    drhodor

    Joined:
    Aug 18, 2013
    Posts:
    39
    Found this too on 2018.3.
     
  6. MartijnGG

    MartijnGG

    Joined:
    May 3, 2018
    Posts:
    74
    I'm still seeing this issue on 2019.1.3f1 with Entities preview.33
    It seems IL2CPP for iOS is stripping out native code which is referenced by C# that wasn't stripped?
     
  7. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    You can add a link.xml to prevent assemblies from getting stripped.. You could do it very fine-grained, but if you're willing to sacrifice a little in build-size you can prevent entire assemblies from being stripped.
    https://docs.unity3d.com/Manual/IL2CPP-BytecodeStripping.html
     
  8. MartijnGG

    MartijnGG

    Joined:
    May 3, 2018
    Posts:
    74
    This only allows you to specify what Managed assembly to prevent from being stripped. The issue here is that Native functions are being stripped, which the managed code references.
     
  9. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    UnityEngine.Jobs is a managed assembly.
     
  10. MartijnGG

    MartijnGG

    Joined:
    May 3, 2018
    Posts:
    74
    Yes, and its not being stripped. The Native code it references is.
     
  11. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    Which native code?

    Edit: Do you mean the UnityEngine.Jobs-Code? That's being stripped because it's never called (because the package-code which calls it is also stripped)
     
    Last edited: Jun 6, 2019