Search Unity

Bug [0.6.0-preview.3] IL2CPP build does not work properly

Discussion in 'DOTS Physics' started by optimise, Feb 3, 2021.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    998
    Hi @steveeHavok. After I try to roll out Window build with IL2CPP, it does not work properly. I believe it's DOTS Physics bug. I'm using latest 0.6.0-preview.3 public release version.

    Below is the log I found:

    The method `Void _mono_to_burst_Hash64Long(Byte*, Byte*, Int64, Byte*, UInt64 ByRef)` must have `MonoPInvokeCallback` attribute to be compatible with IL2CPP!
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    Unity.Burst.BurstCompiler:Compile(T, Boolean)
    Unity.Collections.xxHash3:.cctor()
    Unity.Physics.Authoring.BeginColliderConversionSystem:OnCreate()
    Unity.Entities.ComponentSystemBase:CreateInstance(World, SystemState*)
    Unity.Entities.World:AddSystem_OnCreate_Internal(ComponentSystemBase)
    Unity.Entities.World:CreateSystemInternal(Type)
    Unity.Entities.World:GetOrCreateSystem(Type)
    Unity.Entities.GameObjectConversionUtility:AddSystemAndLogException(World, ComponentSystemGroup, Type)
    Unity.Entities.GameObjectConversionUtility:AddConversionSystems(World, IEnumerable`1, Boolean, Boolean)
    Unity.Entities.GameObjectConversionUtility:CreateConversionWorld(GameObjectConversionSettings, Scene)
    Unity.Entities.ConvertToEntitySystem:Convert()
    Unity.Entities.ComponentSystem:Update()
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
    Unity.Entities.ComponentSystem:Update()
    UnityEngine.LowMemoryCallback:Invoke()

    The method `Void _mono_to_burst_Hash128Long(Byte*, Byte*, Int64, Byte*, Unity.Mathematics.uint4 ByRef)` must have `MonoPInvokeCallback` attribute to be compatible with IL2CPP!
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    Unity.Burst.BurstCompiler:Compile(T, Boolean)
    Unity.Collections.xxHash3:.cctor()
    Unity.Physics.Authoring.BeginColliderConversionSystem:OnCreate()
    Unity.Entities.ComponentSystemBase:CreateInstance(World, SystemState*)
    Unity.Entities.World:AddSystem_OnCreate_Internal(ComponentSystemBase)
    Unity.Entities.World:CreateSystemInternal(Type)
    Unity.Entities.World:GetOrCreateSystem(Type)
    Unity.Entities.GameObjectConversionUtility:AddSystemAndLogException(World, ComponentSystemGroup, Type)
    Unity.Entities.GameObjectConversionUtility:AddConversionSystems(World, IEnumerable`1, Boolean, Boolean)
    Unity.Entities.GameObjectConversionUtility:CreateConversionWorld(GameObjectConversionSettings, Scene)
    Unity.Entities.ConvertToEntitySystem:Convert()
    Unity.Entities.ComponentSystem:Update()
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
    Unity.Entities.ComponentSystem:Update()
    UnityEngine.LowMemoryCallback:Invoke()
     
    Last edited: Feb 4, 2021
    MNNoxMortem likes this.
  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    480
    hmm, that sounds a little familiar. You hitting this with the Unity Physics samples project?
     
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    998
    @steveeHavok Nope. My own game project. You can refer to Case 1308787. Btw I updated the log. There's _mono_to_burst_Hash64Long and _mono_to_burst_Hash128Long
     
    Last edited: Feb 4, 2021
  4. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    480
    I can't repro exactly what you are seeing but we have seen similar problems in the past.

    Would you be able to make the Unity.Collections package local and try adding in an attribute to the _mono_to_burst_Hash64Long function in xxHash3.cs?

    upload_2021-2-4_10-48-34.png
     
  5. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    998
    Seems like this issue is fixed but I still have IL2CPP crash issue (Case 1308787). Not sure why.
     
  6. gmentat

    gmentat

    Joined:
    Nov 12, 2012
    Posts:
    12
    @steveeHavok I'm having the same issue (a project with IL2CPP crashes at launch). Physics Samples also crashes. Unity 2020.3.0f (same in 2020.2.7).

    I'd like to try the solution above, but how do you make the collections package local? It gets auto resolved at start as a built-in package.
     
  7. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,029
    Copy it into your /Packages/ folder
     
    gmentat likes this.
  8. gmentat

    gmentat

    Joined:
    Nov 12, 2012
    Posts:
    12
    Thanks, @tertle!

    @steveeHavok The solution above doesn't work. The Samples project still crashes (IL2CPP/.Net4x). Are there any other possible solutions?
     
  9. milos85miki

    milos85miki

    Joined:
    Nov 29, 2019
    Posts:
    197
  10. gmentat

    gmentat

    Joined:
    Nov 12, 2012
    Posts:
    12
unityunity