Search Unity

Bug Unity Project works only in Development Build on IL2CPP

Discussion in 'Editor & General Support' started by opacicpetar96, May 20, 2021.

  1. opacicpetar96

    opacicpetar96

    Joined:
    Nov 20, 2019
    Posts:
    26
    Hello!

    It looks like I'm having an IL2CPP issue. When building my mobile project to iOS, the build is successful but when the game starts on the device I'm getting this error in the Xcode:

    Code (CSharp):
    1. Built from '2020.2/release' branch, Version '2020.2.1f1 (270dd8c3da1c)', Build type 'Release', Scripting Backend 'il2cpp'
    2. -> applicationDidFinishLaunching()
    3. -> applicationDidBecomeActive()
    4. [Subsystems] Discovering subsystems at path /private/var/containers/Bundle/Application/DB3C1834-26D7-4845-BECA-852578AAB044/Buzzy.app/Data/UnitySubsystems
    5. GfxDevice: creating device client; threaded=1
    6. Initializing Metal device caps: Apple A10 GPU
    7. Initialize engine version: 2020.2.1f1 (270dd8c3da1c)
    8. 2021-05-11 14:47:50.829744+0200 Buzzy[1582:173281] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x127f776f0>.
    9. UnloadTime: 2.462500 ms
    10. Unable to find internal function `UnityEngine.Jobs.TransformAccess::GetWorldToLocalMatrix`
    11. Unity.Burst.BurstCompilerHelper:IsCompiledByBurst(Delegate)
    12. Unity.Burst.BurstCompilerHelper:.cctor()
    13. Unity.Burst.BurstCompiler:Compile(T, Boolean)
    14. Unity.Entities.ComponentSystemGroup:.cctor()
    15. Unity.Entities.InitializationSystemGroup:.ctor()
    16. System.Reflection.MonoCMethod:InternalInvoke(Object, Object[])
    17. System.Activator:CreateInstance(Type, Boolean)
    18. Unity.Entities.TypeManager:ConstructSystem(Type)
    19. Unity.Entities.World:CreateSystemInternal(Type)
    20. Unity.Entities.World:GetOrCreateSystem()
    21. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    22. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    23. Unity.Entities.AutomaticWorldBootstrap:Initialize()
    I'm using Unity 2020.2.1f1.
    I looked around on the web and found some similar threads and most of them suggested adding an link.xml file to the assets folder. I did that and my xml looks like this:

    Code (CSharp):
    1. <linker>
    2.   <assembly fullname="Unity.Collections" preserve="all" />
    3.   <assembly fullname="Unity.Collections.Tests" preserve="all" />
    4.   <assembly fullname="Unity.Burst.Tests" preserve="all" />
    5.   <assembly fullname="Unity.Transforms" preserve="all" />
    6.   <assembly fullname="Unity.Transforms.Hybrid" preserve="all" />
    7.   <assembly fullname="Unity.Transforms.Tests" preserve="all" />
    8.   <assembly fullname="Unity.Jobs" preserve="all" />
    9.   <assembly fullname="Unity.Jobs.Tests" preserve="all" />
    10.   <assembly fullname="UnityEngine.Jobs" preserve="all" />
    11.   <assembly fullname="UnityEngine.Jobs.TransformAccess" preserve="all" />
    12.   <assembly fullname="Unity.Burst" preserve="all" />
    13.   <assembly fullname="Unity.Entities" preserve="all" />
    14. </linker>
    15.  
    But this didn't solve the issue either. Some other things I tried out:
    - Disabling Strip Engine Code
    - Updating Jobs and Burst packages
    - Enabling/Disabling Burst compilation
    None of these worked. :(

    I can also reproduce this issue if I build my project to android with IL2CPP scripting backend. If I build it to Android with Mono scripting backend, it works like a charm...

    Any idea how to fix this issue?

    EDIT
    If I build the project with "Development Build" enabled it runs normally on IL2CPP Android. But If I uncheck the Development Build, it crashes like before. Strange. Any possible info on this?
     
    Last edited: May 20, 2021
  2. opacicpetar96

    opacicpetar96

    Joined:
    Nov 20, 2019
    Posts:
    26