"Null function or function signature mismatch" error when Native .a plugin used in WebGL

Hi, I am porting SkiaSharp project to work in Unity:
https://github.com/dr-vij/SkiaSharpForUnity
There is only Unity WebGL native library yet, and I found a strange behavior that looks like a bug. So, I’ll tell what I’ve done and what have happened then:

  • I built Skia native libraries using Emscripten 2.0.19 (same version as Unity 2021.2.0f1 editor has) The library: libSkiaSharp.a in Plugins folder.
  • I added SkiaSharp managed library with static bindings. Bindings are inside SkiaApi.generated.cs in Scripts/SkiaWrapper folder.
  • I created a simple scene whit a cube and SkiaTest.cs that creates 64x64 green bitmap and draws a black circle in it’s center and sets it to Texture2D on cube material.

And now, the problem that I am investigating is:
Everything works fine in development build only. You can see it at:
https://vij.app/skia-unity-dev/
or you can build it from my repository (Unity2021.2.0f1_DEV_BUILD_WORLS_ONLY tag).
Just select WebGL and set Development build in Build settings. (Unity 2021.2.0f1)
You should see something like this after start:

The logs are also fine:
Successfull log

skia-unity-dev.framework.js:1746 Test start
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

_JS_Log_Dump @ skia-unity-dev.framework.js:1746
skia-unity-dev.framework.js:1746 bitmap was created
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

_JS_Log_Dump @ skia-unity-dev.framework.js:1746
skia-unity-dev.framework.js:1746 skCanvas was created
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

_JS_Log_Dump @ skia-unity-dev.framework.js:1746
skia-unity-dev.framework.js:1746 skSolor was prepared
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

_JS_Log_Dump @ skia-unity-dev.framework.js:1746
skia-unity-dev.framework.js:1746 skCanvas was cleared
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

_JS_Log_Dump @ skia-unity-dev.framework.js:1746
skia-unity-dev.framework.js:1746 circle was drawn
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

_JS_Log_Dump @ skia-unity-dev.framework.js:1746
skia-unity-dev.framework.js:1746 skCanvas was Flushed
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

_JS_Log_Dump @ skia-unity-dev.framework.js:1746
skia-unity-dev.framework.js:1746 bitmap was loaded to unity texture
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

_JS_Log_Dump @ skia-unity-dev.framework.js:1746
skia-unity-dev.framework.js:1746 texture was applied and set to material
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

_JS_Log_Dump @ skia-unity-dev.framework.js:1746
skia-unity-dev.framework.js:1746 Test end
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

But nothing works at all if you try the same in nondevelopment build (Development build checkbox unselected). You can see it at:
https://vij.app/skia-unity/
Or build yourself from the same repository with the same tag and all settings, but Development Build must be not checked

The result looks like this:

and the logs are:

Errors log

Test start
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
SkiaTest:Start()

exception thrown: RuntimeError: null function or function signature mismatch,RuntimeError: null function or function signature mismatch
    at wasm://wasm/05bbe122:wasm-function[16507]:0x80d776
    at wasm://wasm/05bbe122:wasm-function[3265]:0x12ef46
    at wasm://wasm/05bbe122:wasm-function[3266]:0x12f05f
    at wasm://wasm/05bbe122:wasm-function[5633]:0x26e4c1
    at wasm://wasm/05bbe122:wasm-function[16148]:0x7e70fc
    at wasm://wasm/05bbe122:wasm-function[7797]:0x3cc79b
    at wasm://wasm/05bbe122:wasm-function[2495]:0xcdaec
    at wasm://wasm/05bbe122:wasm-function[47786]:0x1430563
    at wasm://wasm/05bbe122:wasm-function[19143]:0x90f60f
    at invoke_i (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422394)
    at wasm://wasm/05bbe122:wasm-function[46729]:0x13fbfbb
    at wasm://wasm/05bbe122:wasm-function[38683]:0x1141cf5
    at invoke_ii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:421906)
    at wasm://wasm/05bbe122:wasm-function[46730]:0x13fc05a
    at wasm://wasm/05bbe122:wasm-function[26999]:0xbf06b0
    at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    at wasm://wasm/05bbe122:wasm-function[1497]:0x67ce4
    at wasm://wasm/05bbe122:wasm-function[3560]:0x158ad5
    at wasm://wasm/05bbe122:wasm-function[1359]:0x5853e
    at wasm://wasm/05bbe122:wasm-function[19146]:0x90f637
    at invoke_vi (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422892)
    at wasm://wasm/05bbe122:wasm-function[19893]:0x93a2c5
    at wasm://wasm/05bbe122:wasm-function[26999]:0xbf06b0
    at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    at wasm://wasm/05bbe122:wasm-function[1497]:0x67ce4
    at wasm://wasm/05bbe122:wasm-function[3560]:0x158ad5
    at wasm://wasm/05bbe122:wasm-function[1359]:0x5853e
    at wasm://wasm/05bbe122:wasm-function[19146]:0x90f637
    at invoke_vi (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422892)
    at wasm://wasm/05bbe122:wasm-function[18369]:0x8ea23a
    at wasm://wasm/05bbe122:wasm-function[19138]:0x90f4e6
    at invoke_viiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:423053)
    at wasm://wasm/05bbe122:wasm-function[18368]:0x8e9fe5
    at wasm://wasm/05bbe122:wasm-function[19149]:0x90f65d
    at invoke_vii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:421746)
    at wasm://wasm/05bbe122:wasm-function[18364]:0x8e9a86
    at wasm://wasm/05bbe122:wasm-function[19138]:0x90f4e6
    at invoke_viiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:423053)
    at wasm://wasm/05bbe122:wasm-function[18365]:0x8e9d38
    at wasm://wasm/05bbe122:wasm-function[19144]:0x90f61d
    at invoke_viii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422735)
    at wasm://wasm/05bbe122:wasm-function[42818]:0x12cd8db
    at wasm://wasm/05bbe122:wasm-function[27746]:0xc0245b
    at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
printErr @ skia-unity.loader.js:1
callUserCallback @ skia-unity.framework.js:2
runIter @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
skia-unity.loader.js:1 Invoking error handler due to
RuntimeError: null function or function signature mismatch
at wasm://wasm/05bbe122:wasm-function[16507]:0x80d776
    at wasm://wasm/05bbe122:wasm-function[3265]:0x12ef46
    at wasm://wasm/05bbe122:wasm-function[3266]:0x12f05f
    at wasm://wasm/05bbe122:wasm-function[5633]:0x26e4c1
    at wasm://wasm/05bbe122:wasm-function[16148]:0x7e70fc
    at wasm://wasm/05bbe122:wasm-function[7797]:0x3cc79b
    at wasm://wasm/05bbe122:wasm-function[2495]:0xcdaec
    at wasm://wasm/05bbe122:wasm-function[47786]:0x1430563
    at wasm://wasm/05bbe122:wasm-function[19143]:0x90f60f
    at invoke_i (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422394)
    at wasm://wasm/05bbe122:wasm-function[46729]:0x13fbfbb
    at wasm://wasm/05bbe122:wasm-function[38683]:0x1141cf5
    at invoke_ii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:421906)
    at wasm://wasm/05bbe122:wasm-function[46730]:0x13fc05a
    at wasm://wasm/05bbe122:wasm-function[26999]:0xbf06b0
    at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    at wasm://wasm/05bbe122:wasm-function[1497]:0x67ce4
    at wasm://wasm/05bbe122:wasm-function[3560]:0x158ad5
    at wasm://wasm/05bbe122:wasm-function[1359]:0x5853e
    at wasm://wasm/05bbe122:wasm-function[19146]:0x90f637
    at invoke_vi (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422892)
    at wasm://wasm/05bbe122:wasm-function[19893]:0x93a2c5
    at wasm://wasm/05bbe122:wasm-function[26999]:0xbf06b0
    at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    at wasm://wasm/05bbe122:wasm-function[1497]:0x67ce4
    at wasm://wasm/05bbe122:wasm-function[3560]:0x158ad5
    at wasm://wasm/05bbe122:wasm-function[1359]:0x5853e
    at wasm://wasm/05bbe122:wasm-function[19146]:0x90f637
    at invoke_vi (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422892)
    at wasm://wasm/05bbe122:wasm-function[18369]:0x8ea23a
    at wasm://wasm/05bbe122:wasm-function[19138]:0x90f4e6
    at invoke_viiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:423053)
    at wasm://wasm/05bbe122:wasm-function[18368]:0x8e9fe5
    at wasm://wasm/05bbe122:wasm-function[19149]:0x90f65d
    at invoke_vii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:421746)
    at wasm://wasm/05bbe122:wasm-function[18364]:0x8e9a86
    at wasm://wasm/05bbe122:wasm-function[19138]:0x90f4e6
    at invoke_viiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:423053)
    at wasm://wasm/05bbe122:wasm-function[18365]:0x8e9d38
    at wasm://wasm/05bbe122:wasm-function[19144]:0x90f61d
    at invoke_viii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422735)
    at wasm://wasm/05bbe122:wasm-function[42818]:0x12cd8db
    at wasm://wasm/05bbe122:wasm-function[27746]:0xc0245b
    at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
skia-unity.framework.js:2 Uncaught RuntimeError: null function or function signature mismatch
    at 05bbe122:0x80d776
    at 05bbe122:0x12ef46
    at 05bbe122:0x12f05f
    at 05bbe122:0x26e4c1
    at 05bbe122:0x7e70fc
    at 05bbe122:0x3cc79b
    at 05bbe122:0xcdaec
    at 05bbe122:0x1430563
    at 05bbe122:0x90f60f
    at invoke_i (skia-unity.framework.js:2)
    at 05bbe122:0x13fbfbb
    at 05bbe122:0x1141cf5
    at invoke_ii (skia-unity.framework.js:2)
    at 05bbe122:0x13fc05a
    at 05bbe122:0xbf06b0
    at 05bbe122:0x236081
    at 05bbe122:0x90f645
    at invoke_iiii (skia-unity.framework.js:2)
    at 05bbe122:0x67ce4
    at 05bbe122:0x158ad5
    at 05bbe122:0x5853e
    at 05bbe122:0x90f637
    at invoke_vi (skia-unity.framework.js:2)
    at 05bbe122:0x93a2c5
    at 05bbe122:0xbf06b0
    at 05bbe122:0x236081
    at 05bbe122:0x90f645
    at invoke_iiii (skia-unity.framework.js:2)
    at 05bbe122:0x67ce4
    at 05bbe122:0x158ad5
    at 05bbe122:0x5853e
    at 05bbe122:0x90f637
    at invoke_vi (skia-unity.framework.js:2)
    at 05bbe122:0x8ea23a
    at 05bbe122:0x90f4e6
    at invoke_viiii (skia-unity.framework.js:2)
    at 05bbe122:0x8e9fe5
    at 05bbe122:0x90f65d
    at invoke_vii (skia-unity.framework.js:2)
    at 05bbe122:0x8e9a86
    at 05bbe122:0x90f4e6
    at invoke_viiii (skia-unity.framework.js:2)
    at 05bbe122:0x8e9d38
    at 05bbe122:0x90f61d
    at invoke_viii (skia-unity.framework.js:2)
    at 05bbe122:0x12cd8db
    at 05bbe122:0xc0245b
    at 05bbe122:0x236081
    at 05bbe122:0x90f645
    at invoke_iiii (skia-unity.framework.js:2)
$func16507 @ 05bbe122:0x80d776
$func3265 @ 05bbe122:0x12ef46
$func3266 @ 05bbe122:0x12f05f
$func5633 @ 05bbe122:0x26e4c1
$func16148 @ 05bbe122:0x7e70fc
$func7797 @ 05bbe122:0x3cc79b
$func2495 @ 05bbe122:0xcdaec
$func47786 @ 05bbe122:0x1430563
$oq @ 05bbe122:0x90f60f
invoke_i @ skia-unity.framework.js:2
$func46729 @ 05bbe122:0x13fbfbb
$iq @ 05bbe122:0x1141cf5
invoke_ii @ skia-unity.framework.js:2
$func46730 @ 05bbe122:0x13fc05a
$func26999 @ 05bbe122:0xbf06b0
$func5149 @ 05bbe122:0x236081
$jq @ 05bbe122:0x90f645
invoke_iiii @ skia-unity.framework.js:2
$func1497 @ 05bbe122:0x67ce4
$func3560 @ 05bbe122:0x158ad5
$func1359 @ 05bbe122:0x5853e
$lq @ 05bbe122:0x90f637
invoke_vi @ skia-unity.framework.js:2
$func19893 @ 05bbe122:0x93a2c5
$func26999 @ 05bbe122:0xbf06b0
$func5149 @ 05bbe122:0x236081
$jq @ 05bbe122:0x90f645
invoke_iiii @ skia-unity.framework.js:2
$func1497 @ 05bbe122:0x67ce4
$func3560 @ 05bbe122:0x158ad5
$func1359 @ 05bbe122:0x5853e
$lq @ 05bbe122:0x90f637
invoke_vi @ skia-unity.framework.js:2
$func18369 @ 05bbe122:0x8ea23a
$sq @ 05bbe122:0x90f4e6
invoke_viiii @ skia-unity.framework.js:2
$func18368 @ 05bbe122:0x8e9fe5
$gq @ 05bbe122:0x90f65d
invoke_vii @ skia-unity.framework.js:2
$func18364 @ 05bbe122:0x8e9a86
$sq @ 05bbe122:0x90f4e6
invoke_viiii @ skia-unity.framework.js:2
$func18365 @ 05bbe122:0x8e9d38
$nq @ 05bbe122:0x90f61d
invoke_viii @ skia-unity.framework.js:2
$func42818 @ 05bbe122:0x12cd8db
$func27746 @ 05bbe122:0xc0245b
$func5149 @ 05bbe122:0x236081
$jq @ 05bbe122:0x90f645
invoke_iiii @ skia-unity.framework.js:2
$func1497 @ 05bbe122:0x67ce4
$func15323 @ 05bbe122:0x773a9b
$func1108 @ 05bbe122:0x3dbb5
$func3123 @ 05bbe122:0x11d122
$func26083 @ 05bbe122:0xbbf6a2
$func22657 @ 05bbe122:0xa25383
$func21183 @ 05bbe122:0x961a86
$func10774 @ 05bbe122:0x5ed88f
$func10774 @ 05bbe122:0x5ed8fe
$func8475 @ 05bbe122:0x433b99
$pq @ 05bbe122:0x90f607
browserIterationFunc @ skia-unity.framework.js:2
callUserCallback @ skia-unity.framework.js:2
runIter @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
requestAnimationFrame (async)
requestAnimationFrame @ skia-unity.framework.js:2
Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
Browser_mainLoop_runner @ skia-unity.framework.js:2
Show 35 more frames
36skia-unity.framework.js:2 An abnormal situation has occurred: the PlayerLoop internal function has been called recursively. Please contact Customer Support with a sample project so that we can reproduce the problem and troubleshoot it.
SkiaSharp.SkiaApi:sk_fontmgr_ref_default()
SkiaSharp.SKFontManager:.cctor()
SkiaSharp.SKObject:.cctor()
SkiaSharp.SKBitmap:.ctor(IntPtr, Boolean)
SkiaSharp.SKBitmap:.ctor()
SkiaSharp.SKBitmap:.ctor(SKImageInfo, Int32)
SkiaSharp.SKBitmap:.ctor(SKImageInfo)
SkiaTest:Start()

Error log 2

[ line 8174292]
An abnormal situation has occurred: the PlayerLoop internal function has been called recursively. Please contact Customer Support with a sample project so that we can reproduce the problem and troubleshoot it.
SkiaSharp.SkiaApi:sk_fontmgr_ref_default()
SkiaSharp.SKFontManager:.cctor()
SkiaSharp.SKObject:.cctor()
SkiaSharp.SKBitmap:.ctor(IntPtr, Boolean)
SkiaSharp.SKBitmap:.ctor()
SkiaSharp.SKBitmap:.ctor(SKImageInfo, Int32)
SkiaSharp.SKBitmap:.ctor(SKImageInfo)
SkiaTest:Start()
[ line 8174292]

p.s. I’ve already sent bug report with links to:

https://vij.app/skia-unity-dev
https://vij.app/skia-unity
https://github.com/dr-vij/SkiaSharpForUnity

Hope it will help in problem investigation

2021.2.1f1 - Same behaviour.

Reported a bug, Case 1377787

i had the same issue in 2021.1 . i fixed it my enabling decompreson fallback, although that isn’t fixing it now. Have you guys fixed the problem yet?

1 Like

2021.2.2f1 - Same error.

I have solved this issue by changing Player Settings > Publishing Settings > Enable Exceptions to Full Without Stacktrace.

14 Likes

Thank you, I’ve just checked, but unfortunately, this option does not solve the issue in my case. I apologise that is something special case with native lib

2021.2.3f1 - Same error.

The issue has been registered

1 Like

2021.2.4f1 - Same error.

1 Like

As the issue is still ‘active’, I don’t think it’s worth pointing every version it is still happening…

I am bumping cause error is critical and not mentioned as in progress or something like this. I know bugs that were not fixed by Unity for years. This forum is my only communication way to be sure something will be seen and fixed maybe. The problem also not mentioned in “Known issues” in Unity release and no any information about its priority. So I do all I can. Bump my problem in forum.

p.s. Maybe somebody will see it and vote by the provided link to issue

4 Likes

Fair point.

My suggestion is then to try to poke some of the active Unity Devs using “@” (you can find them in various posts here). They might at least give you some some backgrounder as to why it’s lower in the priorities. Or if there’s another issue# that’s blocking the resolution.

2 Likes

@JoshPeterson , @LeonhardP , Hi!

Maybe I could ask you, sorry for bumping in forum and wasting your time, but could you please tell if this bug will be fixed in 2021.2? It totally blocks from using native libraries like skia in unity. And it seems that it can be fixed cause everything works fine in development build mode.

To save your time:
The bug:

The repo with reproduction:
https://github.com/dr-vij/SkiaSharpForUnity

The working dev build:
https://vij.app/skia-unity-dev/

The buggy non-dev build:
https://vij.app/skia-unity/

ps. Checked 2021.2.5, not fixed yet

It looks like that bug is not corrected, but is being actively worked on.

1 Like

Thank you for so quick response)

Hi!

I’m currently investigating the bug and in Unity 2022.1 the error also occurs in Development Builds. Which at least gave me a better stack trace:

 RuntimeError: null function or function signature mismatch,RuntimeError: null function or function signature mismatch
    at tt_face_done (http://localhost:8080/Build/Build.wasm:wasm-function[15769]:0x685195)
    at destroy_face (http://localhost:8080/Build/Build.wasm:wasm-function[7694]:0x299c13)
    at FT_Done_Face (http://localhost:8080/Build/Build.wasm:wasm-function[7693]:0x299aab)
    at SkTypeface_FreeType::Scanner::scanFont(SkStreamAsset*, int, SkString*, SkFontStyle*, bool*, SkSTArray<4, SkTypeface_FreeType::Scanner::AxisDefinition, true>*) const (http://localhost:8080/Build/Build.wasm:wasm-function[16251]:0x6caee6)
    at EmbeddedSystemFontLoader::loadSystemFonts(SkTypeface_FreeType::Scanner const&, SkTArray<sk_sp<SkFontStyleSet_Custom>, false>*) const (http://localhost:8080/Build/Build.wasm:wasm-function[16286]:0x6ccb36)
    at SkFontMgr::Factory() (http://localhost:8080/Build/Build.wasm:wasm-function[16287]:0x6cd0c1)
    at SkFontMgr::RefDefault() (http://localhost:8080/Build/Build.wasm:wasm-function[16292]:0x6cd3d7)
    at sk_fontmgr_ref_default (http://localhost:8080/Build/Build.wasm:wasm-function[16354]:0x6cec42)
    at dynCall_i (http://localhost:8080/Build/Build.wasm:wasm-function[53657]:0x164cdd6)
    at http://localhost:8080/Build/Build.framework.js:1035:20
    at invoke_i (http://localhost:8080/Build/Build.framework.js:16777:10)
    at SkiaApi_sk_fontmgr_ref_default_mC50A359E1C8E61B84FB36B258FD0C922480E2CC9 (http://localhost:8080/Build/Build.wasm:wasm-function[17535]:0x717489)
    at GC_call_with_alloc_lock (http://localhost:8080/Build/Build.wasm:wasm-function[1315]:0x74f04)
    at http://localhost:8080/Build/Build.framework.js:1035:20
    at invoke_ii (http://localhost:8080/Build/Build.framework.js:16711:10)
    at SKFontManager__cctor_m11F619CA07BC8C92D3056C5796899FA628F71D7D (http://localhost:8080/Build/Build.wasm:wasm-function[17534]:0x71734b)
    at RuntimeInvoker_FalseVoid_t4861ACF8F4594C3437BB48B6E56783494B843915(void (*)(), MethodInfo const*, void*, void**, void*) (http://localhost:8080/Build/Build.wasm:wasm-function[40618]:0xfd7959)
    at il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) (http://localhost:8080/Build/Build.wasm:wasm-function[40789]:0xfdba8b)
    at dynCall_iiii (http://localhost:8080/Build/Build.wasm:wasm-function[53649]:0x164cd68)
    at http://localhost:8080/Build/Build.framework.js:1035:20
    at invoke_iiii (http://localhost:8080/Build/Build.framework.js:16755:10)
    at il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) (http://localhost:8080/Build/Build.wasm:wasm-function[40766]:0xfdadbd)
    at il2cpp::vm::Runtime::ClassInit(Il2CppClass*) (http://localhost:8080/Build/Build.wasm:wasm-function[40765]:0xfdabd0)
    at il2cpp_codegen_runtime_class_init_inline(Il2CppClass*) (http://localhost:8080/Build/Build.wasm:wasm-function[38740]:0xfb0f54)
    at dynCall_vi (http://localhost:8080/Build/Build.wasm:wasm-function[53650]:0x164cd72)
    at http://localhost:8080/Build/Build.framework.js:1035:20
    at invoke_vi (http://localhost:8080/Build/Build.framework.js:16766:3)
    at SKObject__cctor_mF41768EF53FFA40A0EDB6E419FD3DD73E10FE0BC (http://localhost:8080/Build/Build.wasm:wasm-function[19576]:0x78252c)
    at RuntimeInvoker_FalseVoid_t4861ACF8F4594C3437BB48B6E56783494B843915(void (*)(), MethodInfo const*, void*, void**, void*) (http://localhost:8080/Build/Build.wasm:wasm-function[40618]:0xfd7959)
    at il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) (http://localhost:8080/Build/Build.wasm:wasm-function[40789]:0xfdba8b)
    at dynCall_iiii (http://localhost:8080/Build/Build.wasm:wasm-function[53649]:0x164cd68)
    at http://localhost:8080/Build/Build.framework.js:1035:20
    at invoke_iiii (http://localhost:8080/Build/Build.framework.js:16755:10)
    at il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) (http://localhost:8080/Build/Build.wasm:wasm-function[40766]:0xfdadbd)
    at il2cpp::vm::Runtime::ClassInit(Il2CppClass*) (http://localhost:8080/Build/Build.wasm:wasm-function[40765]:0xfdabd0)
    at il2cpp_codegen_runtime_class_init_inline(Il2CppClass*) (http://localhost:8080/Build/Build.wasm:wasm-function[38740]:0xfb0f54)
    at dynCall_vi (http://localhost:8080/Build/Build.wasm:wasm-function[53650]:0x164cd72)
    at http://localhost:8080/Build/Build.framework.js:1035:20
    at invoke_vi (http://localhost:8080/Build/Build.framework.js:16766:3)
    at SKBitmap__ctor_m1BE7E9E284ED20FCE6AF16AB2C92749B2ED4F20B (http://localhost:8080/Build/Build.wasm:wasm-function[21451]:0x7faadb)
    at dynCall_viiii (http://localhost:8080/Build/Build.wasm:wasm-function[53653]:0x164cda0)
    at http://localhost:8080/Build/Build.framework.js:1035:20
    at invoke_viiii (http://localhost:8080/Build/Build.framework.js:16821:3)
    at SKBitmap__ctor_m06B4E2C526CC12118C716CFC257231B860570367 (http://localhost:8080/Build/Build.wasm:wasm-function[21452]:0x7fabdc)
    at dynCall_vii (http://localhost:8080/Build/Build.wasm:wasm-function[53648]:0x164cd5a)
    at http://localhost:8080/Build/Build.framework.js:1035:20
    at invoke_vii (http://localhost:8080/Build/Build.framework.js:16722:3)
    at SKBitmap__ctor_m52B18EDF32F496A8FA12964176FB04682AA82C00 (http://localhost:8080/Build/Build.wasm:wasm-function[20352]:0x7c59a3)
    at dynCall_viiii (http://localhost:8080/Build/Build.wasm:wasm-function[53653]:0x164cda0)
    at http://localhost:8080/Build/Build.framework.js:1035:20

It looks to me like Skia uses an external library for rendering FreeType fonts and calling a function of this library is what is causing the crash. Do you know if this free type library is statically linked into “libSkiaSharp.a”? If not it probably needs to be included in the Unity WebGL project. If the library is already statically linked then maybe there is a version mismatch so that “tt_face_done” has a different call signature.

1 Like

Hi! Thank you for you answer. I will do what I can to help to investigate it.

So I’ve unpacked the archive, looks like freetype is inside. I’ve also checked native build cake settings. Looks correct too. And skia is built with static settings, so all inner libraries should be statically linked. If signature mismatch, why does it work in dev build in 2021.2? What have changed in 2022 that it stopped building at all on my machine? The logs are not very informative. I can investigate the problem if you could give recommendations what to check

Important addition:
I see that your log in 2022 is not like my in 2021.2.0f1, so I decided to check other versions. I built the project with different versions of unity and thats what I have:

After deeper investigation I found that behaviour has changed after Unity 2021.2.3f1 and development builds stopped working for me since 2021.2.4f1

2021.2.3f1: The last successful development build that works can be created in this version
2021.2.4f1/5f1/6f1: development mode builds but don’t work (for my example I mean)
2022.2.0b1/b2: build fails with exception. Something changed there again. So I cant check these versions

Unity 2021.2.3f1 result in wasm (development build) :

Unity 2021.2.4f1/5f1/6f1 result in wasm (development build):

Unity 2022.1.0b1/b2 (Compliation error, develpment build):

Building /Users/vij/WorkProjects/MyProjects/SkiaSharpForUnity/Library/Bee/artifacts/WebGL/il2cppOutput/UnityICallRegistration.cpp failed with output:
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /Applications/Unity/Hub/Editor/2022.1.0b2/Unity.app/Contents/MonoBleedingEdge/lib/../lib/libmono-native.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
  at Interop+Sys..cctor () [0x00000] in <310a9ad4970f473680d13544528e598a>:0
   --- End of inner exception stack trace ---
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.Directory.Exists (System.String path) [0x0001e] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x000c1] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00006] in <a6860a9f6366437387ebdc1f225b7fd4>:0
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00008] in <a6860a9f6366437387ebdc1f225b7fd4>:0
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName) [0x00007] in <a6860a9f6366437387ebdc1f225b7fd4>:0
  at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName) [0x00000] in <a6860a9f6366437387ebdc1f225b7fd4>:0
  at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.AssemblyDefinitionFor (System.String path) [0x00001] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.get_AssemblyDefinition () [0x00013] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.CollectAllInternalCalls () [0x00008] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.get_InternalCallsByType () [0x0000e] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Runner.DefaultRunner.Run (Unity.InternalCallRegistrationWriter.Runner.InternalCallOptions options) [0x00022] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Runner.DefaultRunner.ParseOptionsAndRun (System.String[] args) [0x00008] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Program.Main (System.String[] args) [0x00001] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /Applications/Unity/Hub/Editor/2022.1.0b2/Unity.app/Contents/MonoBleedingEdge/lib/../lib/libmono-native.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
  at Interop+Sys..cctor () [0x00000] in <310a9ad4970f473680d13544528e598a>:0
   --- End of inner exception stack trace ---
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.Directory.Exists (System.String path) [0x0001e] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x000c1] in <310a9ad4970f473680d13544528e598a>:0
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00006] in <a6860a9f6366437387ebdc1f225b7fd4>:0
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00008] in <a6860a9f6366437387ebdc1f225b7fd4>:0
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName) [0x00007] in <a6860a9f6366437387ebdc1f225b7fd4>:0
  at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName) [0x00000] in <a6860a9f6366437387ebdc1f225b7fd4>:0
  at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.AssemblyDefinitionFor (System.String path) [0x00001] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.get_AssemblyDefinition () [0x00013] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.CollectAllInternalCalls () [0x00008] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.get_InternalCallsByType () [0x0000e] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Runner.DefaultRunner.Run (Unity.InternalCallRegistrationWriter.Runner.InternalCallOptions options) [0x00022] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Runner.DefaultRunner.ParseOptionsAndRun (System.String[] args) [0x00008] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
  at Unity.InternalCallRegistrationWriter.Program.Main (System.String[] args) [0x00001] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

I hope my information can be usefull. Please feel free to ask me to provide any extra info, I will do it if I can :slight_smile:

I will try to rebuild skia native to make sure that I can create a working example of skfonts rendering

yeh works for me, didnt even need full stacktrace, thanks.

@MarcelPursche , after some investigation I found a way to make native plugin work in 2022.2.0b3.

  1. I removed asmdef
  2. I switched to development build.

Now I get this:

It stopped throwing signature mismatch error and the native plugin works, but there is a new type of error after texture was applied.

The reason of signature mismatch in dev/non dev mode was the asmdef. The application works in dev mode like before after asmdef was removed. Maybe it can help. I can upload example to my repo.

Oh, I’ve tried so much parameters changes and so much builds, now I am totally confused what parameters were the main reason of successfull dev build.

So I’ve set exceptions to none, build mode to development, and it works… but in dev mode only. Very frustrating situation.

soooo, no errors here. looks like it is a combination of problems in 2022/2021.2 after emscripten update maybe

I’ve uploaded this working example to my repo, tag WorksInDevBuild_2022.2.0b3
branch WasmErrorInvestigation.

https://github.com/dr-vij/SkiaSharpForUnity

1 Like