Cannot load "lib_burst_0_0" on Android builds
Hi everyone. I am trying to test my current project on Android. When running the apk, I receive the following error immediately after the Unity splash screen:
D/Unity: Failed to load native plugin: Unable to lookup library path for 'lib_burst_0_0'.
E/Unity: Unable to find lib_burst_0_0
D/Unity: Failed to load native plugin: Unable to lookup library path for '_burst_0_0'.
E/Unity: Unable to find _burst_0_0
E/Unity: Baselib error: <stripped>: Out of memory (0x01000000) - Out of memory (errno:0x0000000c)
UnityEngine.Logger:Log(LogType, Object)
Unity.Collections.LowLevel.Unsafe.VirtualMemoryUtility:ReportWrappedBaselibError(BaselibErrorState)
Unity.Entities._dlg_PlaybackChainChunk:EndInvoke(ArchetypeChanges&, ECBSharedPlaybackState&, IAsyncResult)
Unity.Entities.EntityComponentStore:Create(EntityComponentStore*, UInt64, Int32)
Unity.Entities.EntityDataAccess:Initialize(EntityDataAccess*, World)
Unity.Entities.World:.ctor(String, WorldFlags)
Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
I'm using Unity 2020.1.0f1 with Burst 1.4.0-preview.2 and Entities 0.13.0-preview.24
I'm using the JDK, Android SDK, etc. included with Unity.
My scene does load, but no DOTS related code runs. So, I can see static meshes, but cannot move the camera, and entities do not spawn.
I am testing this using a virtual device in Android Studio. I did make sure other apk's run correctly. When testing on a phone, I did not have access to the log, but the game screen looked the same as it does in the emulator (no DOTS code runs, etc).
The game does run correctly in editor and in a Windows standalone exe
I'm new to Android development, so sorry if this is a rookie mistake. I'm still pulling my hair out over it! Thank you for any help!
I am getting very similar error messages. I have a very simple project - just one mesh, and one material running on a $$anonymous$$otorola X4.
unable to find lib_burst_0_0 and _burst_0_0 Vulkan - Out of memory!
The fbx mesh has: 13,122 vertices, 26,214 faces, 26,214 Tris, and 1 object.
Unity Editor 2020.1.0f1.
Burst 1.3.2, Collections 0.11.0-preview.17, Entities 0.13.0-preview.24, Hybrid Renderer 0.7.0-preview.24, Jobs 0.4.0-preview.18, $$anonymous$$athematics 1.1.0, Scriptable Build Pipeline 1.9.0, Shader Graph 9.0.0-preview.34, Universal RP 9.0.0-preview.35
Hi, just giving an update. I received a message from Unity on my bug report saying that this will be fixed in versions 2020.2.0b2 and later.
Answer by lclemens · Aug 03, 2020 at 06:44 PM
There is another solution.
I was unable to downgrade to Entities 0.11.1. I tried to do it through the package manager, but when I clicked the "Upgrade to 0.11.1" button (which is really a downgrade), the manager still said I have 0.13.0-preview.24. In contrast to the package manager GUI, my manifest.json file says it's using "0.11.1", which makes no sense at all. I think it won't let me downgrade because I am using Hybrid Renderer V2, which depends on 0.13.0-preview.24.
The other solution is to disable Multithreaded Rendering in Player Settings. Everything runs fine with that disabled, however, frame rates may drop :-(
EDIT
Since some people are reporting that disabling multithreaded rendering doesn't fix it, I decided to run some more tests.
I created a URP project in 2020.1.1, then removed the sample assets and disabled the post processing volume. Then I updated URP to 9.0.0-preview.35 and added hybrid renderer 0.7.0-preview.24 and enabled v2. Then I restarted the editor. At this point I had a completely EMPTY project with nothing but the skybox, a directional light (sun) and the default main camera+controller..
When running with multithreaded rendering disabled everything runs fine and this is the resulting logcat showing no crashes: https://drive.google.com/file/d/1hLZKJuWxaNErAOO61HpYyt9dgQ5VoQEb/view?usp=sharing
When running with multithreaded rendering enabled, it crashes after a couple of seconds and this is the resulting logcat: https://drive.google.com/file/d/1Pa4_GteYJsrEknmyB3aEQXaOLAaj0Kun/view?usp=sharing
I also ran a dev build with full logging/stack traces with multithreaded rendering enabled: https://drive.google.com/file/d/1jKITkdEvA3ZJAQrlhX0efDLALnZgxR-8/view?usp=sharing
And lastly, here is the logcat of a run with il2cpp and multithreaded rendering disabled: https://drive.google.com/file/d/1vHMeHrL8u_xx4-eD46Tl8keBw1WPtu9a/view?usp=sharing
I tried various combinations of .Net 2x/4x and mono/il2cpp. They all crashed. il2cpp seemed to have a different crash - instead of waiting a couple of seconds first, it would crash immediately, and most importantly, it crashed even without MTR enabled.
The documentation for hybrid renderer v0.7.0-preview.24 says: "Hybrid Renderer V2 is considered experimental in Unity 2020.1. We have validated it on Windows DX11, DX12, Vulkan and Mac Metal backends in both Editor and Standalone builds. Mobile device and console platform support will be validated in 2020.2."
They weren't kidding. Hybrid renderer v2 with il2cpp does NOT WORK AT ALL. Hybrid renderer v2 with mono scripting backend and multithreaded rendering disabled might work.
One of the Unity tutorials says "You should enable Multithreaded Rendering whenever possible, as it usually benefits performance greatly", so be aware that disabling MTR can cause poor performance. I suspect it will be years before hybrid renderer v2 is ready (if it doesn't get abandoned in favor of a pure entity version beforehand).
I have the same issue and I cannot downgrade the Entities package because I use Hybrid Renderer V2. Disabling $$anonymous$$ultithreaded Rendering has not solved it for me. I have no clue how to fix this. Any updates?
I don't know why disabling $$anonymous$$TR didn't work for you - see my answer to 11marcello11 below.
Did you by chance happen to have il2cpp set as the scripting backend instead of mono?
Disabling $$anonymous$$ultithreaded Rendering has not solved it for me either... did you by any chance change something else too ?
No I didn't change anything else. I double-checked. I made a brand new project, added a mesh with a material, set hybrid renderer to V2, disabled multithreaded rendering, and built for Android. Everything worked. Then I enabled multithreaded rendering and recompiled for the phone and it crashed after a couple of seconds. Then I switched $$anonymous$$TR back off and it worked again.
When I check the logcat, there is the error about burst, but also I see "Vulkan - Out of memory!". I do not know if this is the same issue that Ned$$anonymous$$akesGames is having, but it seems pretty similar.
Answer by NedMakesGames · Jul 28, 2020 at 08:01 PM
I was able to solve this by downgrading to Entities 0.11.1-preview.4
After posting this, I found that I could get a new project to run by removing the entities package. I then downgraded the entities package in my main project to 0.11.1. Then, the game ran correctly. I still saw the "Unable to find lib_burst_0_0" errors, but the "out of memory" error was gone.
Can confirm these findings - also had this problem w/ Oculus Quest.
Also had to drop down to Entities 0.11.1-preview.4 to get ECS to run in-game. Other non-Android builds and in Unity ECS works fine.
Unsure of that actual Lib_Burst error though... lol.