#[1.0.10] Build Android Failed: Burst compiler (1.8.4) failed running

1 messages · Page 1 of 1 (latest)

marble sierra
#
UnityEditor.Build.BuildFailedException: Burst compiler (1.8.4) failed running

stdout:
Starting 1 library requests
.\Library\PackageCache\com.unity.collections@2.1.4\Unity.Collections\AllocatorManager.cs(1581,9): Burst error BC1091: External and internal calls are not allowed inside static constructors: Unity.Jobs.LowLevel.Unsafe.JobsUtility.get_ThreadIndexCount()

 at Unity.Collections.AllocatorManager..cctor() (at .\Library\PackageCache\com.unity.collections@2.1.4\Unity.Collections\AllocatorManager.cs:1581)
 at Unity.Collections.LowLevel.Unsafe.UnsafePtrList`1<Unity.Entities.Archetype>..ctor(Unity.Collections.LowLevel.Unsafe.UnsafePtrList`1<Unity.Entities.Archetype>* this, int initialCapacity, Unity.Collections.AllocatorManager.AllocatorHandle allocator, Unity.Collections.NativeArrayOptions options) (at .\Library\PackageCache\com.unity.collections@2.1.4\Unity.Collections\UnsafeList.cs:1358)

Does anyone get this problem when build the android version?
I'm using Unity 2022.3.0f1, Entities 1.0.10, Burst 1.8.4
I just got this error when I upgraded to the latest version for Unity and DOTS

marble sierra
#

<@&502880774467354641> sorry to bother you guys, but I'm stuck here and time is running out, can you tell me where the problem is?

open night
#

Do you have some stale libraries lingering around perhaps? That issue occurred in older releases of the engine but was addressed in 2022.2.14f1. It's surprising to see it occur

wind pulsar
carmine musk
#

<@&502880774467354641> <@&502884371011731486> wonder if can help

untold charm
marble sierra
marble sierra
open night
#

If you go to definition for JobsUtility.ThreadIndexCount, Rider/VS should decompile the library and show you something like this:

        public static extern int ThreadIndexCount
        {
            [MethodImpl(MethodImplOptions.InternalCall)]
            [FreeFunction("GetJobWorkerIndexCount", IsThreadSafe = true)]
            [BurstAuthorizedExternalMethod]
            get;
        }
#

Does it look like that for you?

The error is suggesting you don't have [BurstAuthorizedExternalMethod] which is an internal attribute to allow Burst to call native functions since we know it will be safe since we know all the special assumptions Burst makes

#

If that attribute is missing then that error fires -- the static constructor is in DOTS code making use of the ThreadIndexCount. I'll double check our internal tests for this but I suspect you have some stale state that is tripping up Burst

#

Since you're using 2022.3, that attribute should be there, so unless there is a new bug I think there is something stale. If possible, if you can clean your project Library and Temp and try again, that would rule out stale binaries

marble sierra
open night
#

Thank you for checking. We've looked internally and it seems like a possible issue with stripping. If you reduce your stripping level to minimal it should work when on 2022.3. We'll work on the proper fix and post the expected fix version when known. Thanks again for the report

marble sierra
#

oh, that's it, I am stripping at high level. Thank for your time🙌

open night
#

The fix for this issue has landed and will be in the 2022.3.3f1 release. Thanks again for the report!