Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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

Discussion in 'WebGL' started by DrViJ, Nov 2, 2021.

  1. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    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:

    1. 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.
    2. I added SkiaSharp managed library with static bindings. Bindings are inside SkiaApi.generated.cs in Scripts/SkiaWrapper folder.
    3. 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:
    Screenshot 2021-11-03 at 00.19.22.png Screenshot 2021-11-03 at 00.54.12.png

    The logs are also fine:
    Code (CSharp):
    1. skia-unity-dev.framework.js:1746 Test start
    2. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    3. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    4. UnityEngine.Logger:Log(LogType, Object)
    5. UnityEngine.Debug:LogWarning(Object)
    6. SkiaTest:Start()
    7.  
    8. _JS_Log_Dump @ skia-unity-dev.framework.js:1746
    9. skia-unity-dev.framework.js:1746 bitmap was created
    10. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    11. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    12. UnityEngine.Logger:Log(LogType, Object)
    13. UnityEngine.Debug:LogWarning(Object)
    14. SkiaTest:Start()
    15.  
    16. _JS_Log_Dump @ skia-unity-dev.framework.js:1746
    17. skia-unity-dev.framework.js:1746 skCanvas was created
    18. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    19. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    20. UnityEngine.Logger:Log(LogType, Object)
    21. UnityEngine.Debug:LogWarning(Object)
    22. SkiaTest:Start()
    23.  
    24. _JS_Log_Dump @ skia-unity-dev.framework.js:1746
    25. skia-unity-dev.framework.js:1746 skSolor was prepared
    26. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    27. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    28. UnityEngine.Logger:Log(LogType, Object)
    29. UnityEngine.Debug:LogWarning(Object)
    30. SkiaTest:Start()
    31.  
    32. _JS_Log_Dump @ skia-unity-dev.framework.js:1746
    33. skia-unity-dev.framework.js:1746 skCanvas was cleared
    34. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    35. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    36. UnityEngine.Logger:Log(LogType, Object)
    37. UnityEngine.Debug:LogWarning(Object)
    38. SkiaTest:Start()
    39.  
    40. _JS_Log_Dump @ skia-unity-dev.framework.js:1746
    41. skia-unity-dev.framework.js:1746 circle was drawn
    42. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    43. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    44. UnityEngine.Logger:Log(LogType, Object)
    45. UnityEngine.Debug:LogWarning(Object)
    46. SkiaTest:Start()
    47.  
    48. _JS_Log_Dump @ skia-unity-dev.framework.js:1746
    49. skia-unity-dev.framework.js:1746 skCanvas was Flushed
    50. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    51. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    52. UnityEngine.Logger:Log(LogType, Object)
    53. UnityEngine.Debug:LogWarning(Object)
    54. SkiaTest:Start()
    55.  
    56. _JS_Log_Dump @ skia-unity-dev.framework.js:1746
    57. skia-unity-dev.framework.js:1746 bitmap was loaded to unity texture
    58. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    59. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    60. UnityEngine.Logger:Log(LogType, Object)
    61. UnityEngine.Debug:LogWarning(Object)
    62. SkiaTest:Start()
    63.  
    64. _JS_Log_Dump @ skia-unity-dev.framework.js:1746
    65. skia-unity-dev.framework.js:1746 texture was applied and set to material
    66. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    67. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    68. UnityEngine.Logger:Log(LogType, Object)
    69. UnityEngine.Debug:LogWarning(Object)
    70. SkiaTest:Start()
    71.  
    72. _JS_Log_Dump @ skia-unity-dev.framework.js:1746
    73. skia-unity-dev.framework.js:1746 Test end
    74. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    75. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    76. UnityEngine.Logger:Log(LogType, Object)
    77. UnityEngine.Debug:LogWarning(Object)
    78. SkiaTest:Start()
    79.  

    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:
    Screenshot 2021-11-03 at 00.33.04.png Screenshot 2021-11-03 at 00.45.56.png Screenshot 2021-11-03 at 00.46.07.png


    and the logs are:

    Code (CSharp):
    1. Test start
    2. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    3. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    4. UnityEngine.Logger:Log(LogType, Object)
    5. UnityEngine.Debug:LogWarning(Object)
    6. SkiaTest:Start()
    7.  
    8. exception thrown: RuntimeError: null function or function signature mismatch,RuntimeError: null function or function signature mismatch
    9.     at wasm://wasm/05bbe122:wasm-function[16507]:0x80d776
    10.     at wasm://wasm/05bbe122:wasm-function[3265]:0x12ef46
    11.     at wasm://wasm/05bbe122:wasm-function[3266]:0x12f05f
    12.     at wasm://wasm/05bbe122:wasm-function[5633]:0x26e4c1
    13.     at wasm://wasm/05bbe122:wasm-function[16148]:0x7e70fc
    14.     at wasm://wasm/05bbe122:wasm-function[7797]:0x3cc79b
    15.     at wasm://wasm/05bbe122:wasm-function[2495]:0xcdaec
    16.     at wasm://wasm/05bbe122:wasm-function[47786]:0x1430563
    17.     at wasm://wasm/05bbe122:wasm-function[19143]:0x90f60f
    18.     at invoke_i (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422394)
    19.     at wasm://wasm/05bbe122:wasm-function[46729]:0x13fbfbb
    20.     at wasm://wasm/05bbe122:wasm-function[38683]:0x1141cf5
    21.     at invoke_ii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:421906)
    22.     at wasm://wasm/05bbe122:wasm-function[46730]:0x13fc05a
    23.     at wasm://wasm/05bbe122:wasm-function[26999]:0xbf06b0
    24.     at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    25.     at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    26.     at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    27.     at wasm://wasm/05bbe122:wasm-function[1497]:0x67ce4
    28.     at wasm://wasm/05bbe122:wasm-function[3560]:0x158ad5
    29.     at wasm://wasm/05bbe122:wasm-function[1359]:0x5853e
    30.     at wasm://wasm/05bbe122:wasm-function[19146]:0x90f637
    31.     at invoke_vi (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422892)
    32.     at wasm://wasm/05bbe122:wasm-function[19893]:0x93a2c5
    33.     at wasm://wasm/05bbe122:wasm-function[26999]:0xbf06b0
    34.     at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    35.     at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    36.     at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    37.     at wasm://wasm/05bbe122:wasm-function[1497]:0x67ce4
    38.     at wasm://wasm/05bbe122:wasm-function[3560]:0x158ad5
    39.     at wasm://wasm/05bbe122:wasm-function[1359]:0x5853e
    40.     at wasm://wasm/05bbe122:wasm-function[19146]:0x90f637
    41.     at invoke_vi (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422892)
    42.     at wasm://wasm/05bbe122:wasm-function[18369]:0x8ea23a
    43.     at wasm://wasm/05bbe122:wasm-function[19138]:0x90f4e6
    44.     at invoke_viiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:423053)
    45.     at wasm://wasm/05bbe122:wasm-function[18368]:0x8e9fe5
    46.     at wasm://wasm/05bbe122:wasm-function[19149]:0x90f65d
    47.     at invoke_vii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:421746)
    48.     at wasm://wasm/05bbe122:wasm-function[18364]:0x8e9a86
    49.     at wasm://wasm/05bbe122:wasm-function[19138]:0x90f4e6
    50.     at invoke_viiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:423053)
    51.     at wasm://wasm/05bbe122:wasm-function[18365]:0x8e9d38
    52.     at wasm://wasm/05bbe122:wasm-function[19144]:0x90f61d
    53.     at invoke_viii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422735)
    54.     at wasm://wasm/05bbe122:wasm-function[42818]:0x12cd8db
    55.     at wasm://wasm/05bbe122:wasm-function[27746]:0xc0245b
    56.     at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    57.     at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    58.     at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    59. printErr @ skia-unity.loader.js:1
    60. callUserCallback @ skia-unity.framework.js:2
    61. runIter @ skia-unity.framework.js:2
    62. Browser_mainLoop_runner @ skia-unity.framework.js:2
    63. requestAnimationFrame (async)
    64. requestAnimationFrame @ skia-unity.framework.js:2
    65. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    66. Browser_mainLoop_runner @ skia-unity.framework.js:2
    67. requestAnimationFrame (async)
    68. requestAnimationFrame @ skia-unity.framework.js:2
    69. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    70. Browser_mainLoop_runner @ skia-unity.framework.js:2
    71. requestAnimationFrame (async)
    72. requestAnimationFrame @ skia-unity.framework.js:2
    73. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    74. Browser_mainLoop_runner @ skia-unity.framework.js:2
    75. requestAnimationFrame (async)
    76. requestAnimationFrame @ skia-unity.framework.js:2
    77. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    78. Browser_mainLoop_runner @ skia-unity.framework.js:2
    79. requestAnimationFrame (async)
    80. requestAnimationFrame @ skia-unity.framework.js:2
    81. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    82. Browser_mainLoop_runner @ skia-unity.framework.js:2
    83. requestAnimationFrame (async)
    84. requestAnimationFrame @ skia-unity.framework.js:2
    85. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    86. Browser_mainLoop_runner @ skia-unity.framework.js:2
    87. requestAnimationFrame (async)
    88. requestAnimationFrame @ skia-unity.framework.js:2
    89. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    90. Browser_mainLoop_runner @ skia-unity.framework.js:2
    91. requestAnimationFrame (async)
    92. requestAnimationFrame @ skia-unity.framework.js:2
    93. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    94. Browser_mainLoop_runner @ skia-unity.framework.js:2
    95. requestAnimationFrame (async)
    96. requestAnimationFrame @ skia-unity.framework.js:2
    97. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    98. Browser_mainLoop_runner @ skia-unity.framework.js:2
    99. requestAnimationFrame (async)
    100. requestAnimationFrame @ skia-unity.framework.js:2
    101. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    102. Browser_mainLoop_runner @ skia-unity.framework.js:2
    103. requestAnimationFrame (async)
    104. requestAnimationFrame @ skia-unity.framework.js:2
    105. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    106. Browser_mainLoop_runner @ skia-unity.framework.js:2
    107. requestAnimationFrame (async)
    108. requestAnimationFrame @ skia-unity.framework.js:2
    109. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    110. Browser_mainLoop_runner @ skia-unity.framework.js:2
    111. requestAnimationFrame (async)
    112. requestAnimationFrame @ skia-unity.framework.js:2
    113. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    114. Browser_mainLoop_runner @ skia-unity.framework.js:2
    115. requestAnimationFrame (async)
    116. requestAnimationFrame @ skia-unity.framework.js:2
    117. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    118. Browser_mainLoop_runner @ skia-unity.framework.js:2
    119. requestAnimationFrame (async)
    120. requestAnimationFrame @ skia-unity.framework.js:2
    121. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    122. Browser_mainLoop_runner @ skia-unity.framework.js:2
    123. requestAnimationFrame (async)
    124. requestAnimationFrame @ skia-unity.framework.js:2
    125. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    126. Browser_mainLoop_runner @ skia-unity.framework.js:2
    127. requestAnimationFrame (async)
    128. requestAnimationFrame @ skia-unity.framework.js:2
    129. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    130. Browser_mainLoop_runner @ skia-unity.framework.js:2
    131. requestAnimationFrame (async)
    132. requestAnimationFrame @ skia-unity.framework.js:2
    133. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    134. Browser_mainLoop_runner @ skia-unity.framework.js:2
    135. requestAnimationFrame (async)
    136. requestAnimationFrame @ skia-unity.framework.js:2
    137. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    138. Browser_mainLoop_runner @ skia-unity.framework.js:2
    139. requestAnimationFrame (async)
    140. requestAnimationFrame @ skia-unity.framework.js:2
    141. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    142. Browser_mainLoop_runner @ skia-unity.framework.js:2
    143. requestAnimationFrame (async)
    144. requestAnimationFrame @ skia-unity.framework.js:2
    145. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    146. Browser_mainLoop_runner @ skia-unity.framework.js:2
    147. requestAnimationFrame (async)
    148. requestAnimationFrame @ skia-unity.framework.js:2
    149. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    150. Browser_mainLoop_runner @ skia-unity.framework.js:2
    151. requestAnimationFrame (async)
    152. requestAnimationFrame @ skia-unity.framework.js:2
    153. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    154. Browser_mainLoop_runner @ skia-unity.framework.js:2
    155. requestAnimationFrame (async)
    156. requestAnimationFrame @ skia-unity.framework.js:2
    157. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    158. Browser_mainLoop_runner @ skia-unity.framework.js:2
    159. requestAnimationFrame (async)
    160. requestAnimationFrame @ skia-unity.framework.js:2
    161. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    162. Browser_mainLoop_runner @ skia-unity.framework.js:2
    163. requestAnimationFrame (async)
    164. requestAnimationFrame @ skia-unity.framework.js:2
    165. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    166. Browser_mainLoop_runner @ skia-unity.framework.js:2
    167. requestAnimationFrame (async)
    168. requestAnimationFrame @ skia-unity.framework.js:2
    169. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    170. Browser_mainLoop_runner @ skia-unity.framework.js:2
    171. requestAnimationFrame (async)
    172. requestAnimationFrame @ skia-unity.framework.js:2
    173. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    174. Browser_mainLoop_runner @ skia-unity.framework.js:2
    175. requestAnimationFrame (async)
    176. requestAnimationFrame @ skia-unity.framework.js:2
    177. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    178. Browser_mainLoop_runner @ skia-unity.framework.js:2
    179. requestAnimationFrame (async)
    180. requestAnimationFrame @ skia-unity.framework.js:2
    181. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    182. Browser_mainLoop_runner @ skia-unity.framework.js:2
    183. requestAnimationFrame (async)
    184. requestAnimationFrame @ skia-unity.framework.js:2
    185. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    186. Browser_mainLoop_runner @ skia-unity.framework.js:2
    187. requestAnimationFrame (async)
    188. requestAnimationFrame @ skia-unity.framework.js:2
    189. Browser_mainLoop_scheduler_rAF @ skia-unity.framework.js:2
    190. Browser_mainLoop_runner @ skia-unity.framework.js:2
    191. skia-unity.loader.js:1 Invoking error handler due to
    192. RuntimeError: null function or function signature mismatch
    193. at wasm://wasm/05bbe122:wasm-function[16507]:0x80d776
    194.     at wasm://wasm/05bbe122:wasm-function[3265]:0x12ef46
    195.     at wasm://wasm/05bbe122:wasm-function[3266]:0x12f05f
    196.     at wasm://wasm/05bbe122:wasm-function[5633]:0x26e4c1
    197.     at wasm://wasm/05bbe122:wasm-function[16148]:0x7e70fc
    198.     at wasm://wasm/05bbe122:wasm-function[7797]:0x3cc79b
    199.     at wasm://wasm/05bbe122:wasm-function[2495]:0xcdaec
    200.     at wasm://wasm/05bbe122:wasm-function[47786]:0x1430563
    201.     at wasm://wasm/05bbe122:wasm-function[19143]:0x90f60f
    202.     at invoke_i (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422394)
    203.     at wasm://wasm/05bbe122:wasm-function[46729]:0x13fbfbb
    204.     at wasm://wasm/05bbe122:wasm-function[38683]:0x1141cf5
    205.     at invoke_ii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:421906)
    206.     at wasm://wasm/05bbe122:wasm-function[46730]:0x13fc05a
    207.     at wasm://wasm/05bbe122:wasm-function[26999]:0xbf06b0
    208.     at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    209.     at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    210.     at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    211.     at wasm://wasm/05bbe122:wasm-function[1497]:0x67ce4
    212.     at wasm://wasm/05bbe122:wasm-function[3560]:0x158ad5
    213.     at wasm://wasm/05bbe122:wasm-function[1359]:0x5853e
    214.     at wasm://wasm/05bbe122:wasm-function[19146]:0x90f637
    215.     at invoke_vi (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422892)
    216.     at wasm://wasm/05bbe122:wasm-function[19893]:0x93a2c5
    217.     at wasm://wasm/05bbe122:wasm-function[26999]:0xbf06b0
    218.     at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    219.     at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    220.     at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    221.     at wasm://wasm/05bbe122:wasm-function[1497]:0x67ce4
    222.     at wasm://wasm/05bbe122:wasm-function[3560]:0x158ad5
    223.     at wasm://wasm/05bbe122:wasm-function[1359]:0x5853e
    224.     at wasm://wasm/05bbe122:wasm-function[19146]:0x90f637
    225.     at invoke_vi (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422892)
    226.     at wasm://wasm/05bbe122:wasm-function[18369]:0x8ea23a
    227.     at wasm://wasm/05bbe122:wasm-function[19138]:0x90f4e6
    228.     at invoke_viiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:423053)
    229.     at wasm://wasm/05bbe122:wasm-function[18368]:0x8e9fe5
    230.     at wasm://wasm/05bbe122:wasm-function[19149]:0x90f65d
    231.     at invoke_vii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:421746)
    232.     at wasm://wasm/05bbe122:wasm-function[18364]:0x8e9a86
    233.     at wasm://wasm/05bbe122:wasm-function[19138]:0x90f4e6
    234.     at invoke_viiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:423053)
    235.     at wasm://wasm/05bbe122:wasm-function[18365]:0x8e9d38
    236.     at wasm://wasm/05bbe122:wasm-function[19144]:0x90f61d
    237.     at invoke_viii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422735)
    238.     at wasm://wasm/05bbe122:wasm-function[42818]:0x12cd8db
    239.     at wasm://wasm/05bbe122:wasm-function[27746]:0xc0245b
    240.     at wasm://wasm/05bbe122:wasm-function[5149]:0x236081
    241.     at wasm://wasm/05bbe122:wasm-function[19147]:0x90f645
    242.     at invoke_iiii (https://vij.app/skia-unity/Build/skia-unity.framework.js:2:422234)
    243.  
    [ 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
     
    Last edited: Nov 3, 2021
  2. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    2021.2.1f1 - Same behaviour.

    Reported a bug, Case 1377787
     
  3. LowtherGames

    LowtherGames

    Joined:
    Oct 16, 2021
    Posts:
    1
    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?
     
    DrViJ likes this.
  4. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    2021.2.2f1 - Same error.
     
  5. Corpano

    Corpano

    Joined:
    Feb 5, 2017
    Posts:
    6
    I have solved this issue by changing Player Settings > Publishing Settings > Enable Exceptions to Full Without Stacktrace.
     
  6. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    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
     
  7. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
  8. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    2021.2.4f1 - Same error.
     
  9. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
    As the issue is still 'active', I don't think it's worth pointing every version it is still happening...
     
  10. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    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
     
    Last edited: Nov 26, 2021
    fwalker and mowax74 like this.
  11. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    376
    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.
     
    Last edited: Nov 26, 2021
    ysftulek and DrViJ like this.
  12. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    @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:
    https://issuetracker.unity3d.com/is...-native-function-from-a-static-linked-library

    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
     
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    It looks like that bug is not corrected, but is being actively worked on.
     
    DrViJ likes this.
  14. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    Thank you for so quick response)
     
  15. MarcelPursche

    MarcelPursche

    Unity Technologies

    Joined:
    Mar 3, 2021
    Posts:
    44
    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:
    Code (CSharp):
    1.  RuntimeError: null function or function signature mismatch,RuntimeError: null function or function signature mismatch
    2.     at tt_face_done (http://localhost:8080/Build/Build.wasm:wasm-function[15769]:0x685195)
    3.     at destroy_face (http://localhost:8080/Build/Build.wasm:wasm-function[7694]:0x299c13)
    4.     at FT_Done_Face (http://localhost:8080/Build/Build.wasm:wasm-function[7693]:0x299aab)
    5.     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)
    6.     at EmbeddedSystemFontLoader::loadSystemFonts(SkTypeface_FreeType::Scanner const&, SkTArray<sk_sp<SkFontStyleSet_Custom>, false>*) const (http://localhost:8080/Build/Build.wasm:wasm-function[16286]:0x6ccb36)
    7.     at SkFontMgr::Factory() (http://localhost:8080/Build/Build.wasm:wasm-function[16287]:0x6cd0c1)
    8.     at SkFontMgr::RefDefault() (http://localhost:8080/Build/Build.wasm:wasm-function[16292]:0x6cd3d7)
    9.     at sk_fontmgr_ref_default (http://localhost:8080/Build/Build.wasm:wasm-function[16354]:0x6cec42)
    10.     at dynCall_i (http://localhost:8080/Build/Build.wasm:wasm-function[53657]:0x164cdd6)
    11.     at http://localhost:8080/Build/Build.framework.js:1035:20
    12.     at invoke_i (http://localhost:8080/Build/Build.framework.js:16777:10)
    13.     at SkiaApi_sk_fontmgr_ref_default_mC50A359E1C8E61B84FB36B258FD0C922480E2CC9 (http://localhost:8080/Build/Build.wasm:wasm-function[17535]:0x717489)
    14.     at GC_call_with_alloc_lock (http://localhost:8080/Build/Build.wasm:wasm-function[1315]:0x74f04)
    15.     at http://localhost:8080/Build/Build.framework.js:1035:20
    16.     at invoke_ii (http://localhost:8080/Build/Build.framework.js:16711:10)
    17.     at SKFontManager__cctor_m11F619CA07BC8C92D3056C5796899FA628F71D7D (http://localhost:8080/Build/Build.wasm:wasm-function[17534]:0x71734b)
    18.     at RuntimeInvoker_FalseVoid_t4861ACF8F4594C3437BB48B6E56783494B843915(void (*)(), MethodInfo const*, void*, void**, void*) (http://localhost:8080/Build/Build.wasm:wasm-function[40618]:0xfd7959)
    19.     at il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) (http://localhost:8080/Build/Build.wasm:wasm-function[40789]:0xfdba8b)
    20.     at dynCall_iiii (http://localhost:8080/Build/Build.wasm:wasm-function[53649]:0x164cd68)
    21.     at http://localhost:8080/Build/Build.framework.js:1035:20
    22.     at invoke_iiii (http://localhost:8080/Build/Build.framework.js:16755:10)
    23.     at il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) (http://localhost:8080/Build/Build.wasm:wasm-function[40766]:0xfdadbd)
    24.     at il2cpp::vm::Runtime::ClassInit(Il2CppClass*) (http://localhost:8080/Build/Build.wasm:wasm-function[40765]:0xfdabd0)
    25.     at il2cpp_codegen_runtime_class_init_inline(Il2CppClass*) (http://localhost:8080/Build/Build.wasm:wasm-function[38740]:0xfb0f54)
    26.     at dynCall_vi (http://localhost:8080/Build/Build.wasm:wasm-function[53650]:0x164cd72)
    27.     at http://localhost:8080/Build/Build.framework.js:1035:20
    28.     at invoke_vi (http://localhost:8080/Build/Build.framework.js:16766:3)
    29.     at SKObject__cctor_mF41768EF53FFA40A0EDB6E419FD3DD73E10FE0BC (http://localhost:8080/Build/Build.wasm:wasm-function[19576]:0x78252c)
    30.     at RuntimeInvoker_FalseVoid_t4861ACF8F4594C3437BB48B6E56783494B843915(void (*)(), MethodInfo const*, void*, void**, void*) (http://localhost:8080/Build/Build.wasm:wasm-function[40618]:0xfd7959)
    31.     at il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) (http://localhost:8080/Build/Build.wasm:wasm-function[40789]:0xfdba8b)
    32.     at dynCall_iiii (http://localhost:8080/Build/Build.wasm:wasm-function[53649]:0x164cd68)
    33.     at http://localhost:8080/Build/Build.framework.js:1035:20
    34.     at invoke_iiii (http://localhost:8080/Build/Build.framework.js:16755:10)
    35.     at il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) (http://localhost:8080/Build/Build.wasm:wasm-function[40766]:0xfdadbd)
    36.     at il2cpp::vm::Runtime::ClassInit(Il2CppClass*) (http://localhost:8080/Build/Build.wasm:wasm-function[40765]:0xfdabd0)
    37.     at il2cpp_codegen_runtime_class_init_inline(Il2CppClass*) (http://localhost:8080/Build/Build.wasm:wasm-function[38740]:0xfb0f54)
    38.     at dynCall_vi (http://localhost:8080/Build/Build.wasm:wasm-function[53650]:0x164cd72)
    39.     at http://localhost:8080/Build/Build.framework.js:1035:20
    40.     at invoke_vi (http://localhost:8080/Build/Build.framework.js:16766:3)
    41.     at SKBitmap__ctor_m1BE7E9E284ED20FCE6AF16AB2C92749B2ED4F20B (http://localhost:8080/Build/Build.wasm:wasm-function[21451]:0x7faadb)
    42.     at dynCall_viiii (http://localhost:8080/Build/Build.wasm:wasm-function[53653]:0x164cda0)
    43.     at http://localhost:8080/Build/Build.framework.js:1035:20
    44.     at invoke_viiii (http://localhost:8080/Build/Build.framework.js:16821:3)
    45.     at SKBitmap__ctor_m06B4E2C526CC12118C716CFC257231B860570367 (http://localhost:8080/Build/Build.wasm:wasm-function[21452]:0x7fabdc)
    46.     at dynCall_vii (http://localhost:8080/Build/Build.wasm:wasm-function[53648]:0x164cd5a)
    47.     at http://localhost:8080/Build/Build.framework.js:1035:20
    48.     at invoke_vii (http://localhost:8080/Build/Build.framework.js:16722:3)
    49.     at SKBitmap__ctor_m52B18EDF32F496A8FA12964176FB04682AA82C00 (http://localhost:8080/Build/Build.wasm:wasm-function[20352]:0x7c59a3)
    50.     at dynCall_viiii (http://localhost:8080/Build/Build.wasm:wasm-function[53653]:0x164cda0)
    51.     at http://localhost:8080/Build/Build.framework.js:1035:20
    52.  
    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.
     
    DrViJ likes this.
  16. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    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

    Screenshot 2021-12-15 at 22.25.48.png

    Screenshot 2021-12-15 at 22.21.24.png
     
    Last edited: Dec 15, 2021
  17. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    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) :
    Screenshot 2021-12-16 at 00.24.22.png

    Unity 2021.2.4f1/5f1/6f1 result in wasm (development build):
    Screenshot 2021-12-16 at 00.32.34.png

    Unity 2022.1.0b1/b2 (Compliation error, develpment build):
    Code (CSharp):
    1. Building /Users/vij/WorkProjects/MyProjects/SkiaSharpForUnity/Library/Bee/artifacts/WebGL/il2cppOutput/UnityICallRegistration.cpp failed with output:
    2. Unhandled Exception:
    3. 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)
    4.   at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
    5.   at Interop+Sys..cctor () [0x00000] in <310a9ad4970f473680d13544528e598a>:0
    6.    --- End of inner exception stack trace ---
    7.   at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <310a9ad4970f473680d13544528e598a>:0
    8.   at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
    9.   at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
    10.   at System.IO.Directory.Exists (System.String path) [0x0001e] in <310a9ad4970f473680d13544528e598a>:0
    11.   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
    12.   at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
    13.   at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    14.   at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00006] in <a6860a9f6366437387ebdc1f225b7fd4>:0
    15.   at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00008] in <a6860a9f6366437387ebdc1f225b7fd4>:0
    16.   at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName) [0x00007] in <a6860a9f6366437387ebdc1f225b7fd4>:0
    17.   at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName) [0x00000] in <a6860a9f6366437387ebdc1f225b7fd4>:0
    18.   at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.AssemblyDefinitionFor (System.String path) [0x00001] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    19.   at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.get_AssemblyDefinition () [0x00013] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    20.   at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.CollectAllInternalCalls () [0x00008] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    21.   at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.get_InternalCallsByType () [0x0000e] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    22.   at Unity.InternalCallRegistrationWriter.Runner.DefaultRunner.Run (Unity.InternalCallRegistrationWriter.Runner.InternalCallOptions options) [0x00022] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    23.   at Unity.InternalCallRegistrationWriter.Runner.DefaultRunner.ParseOptionsAndRun (System.String[] args) [0x00008] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    24.   at Unity.InternalCallRegistrationWriter.Program.Main (System.String[] args) [0x00001] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    25. [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)
    26.   at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
    27.   at Interop+Sys..cctor () [0x00000] in <310a9ad4970f473680d13544528e598a>:0
    28.    --- End of inner exception stack trace ---
    29.   at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <310a9ad4970f473680d13544528e598a>:0
    30.   at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
    31.   at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
    32.   at System.IO.Directory.Exists (System.String path) [0x0001e] in <310a9ad4970f473680d13544528e598a>:0
    33.   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
    34.   at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <310a9ad4970f473680d13544528e598a>:0
    35.   at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    36.   at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00006] in <a6860a9f6366437387ebdc1f225b7fd4>:0
    37.   at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00008] in <a6860a9f6366437387ebdc1f225b7fd4>:0
    38.   at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName) [0x00007] in <a6860a9f6366437387ebdc1f225b7fd4>:0
    39.   at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName) [0x00000] in <a6860a9f6366437387ebdc1f225b7fd4>:0
    40.   at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.AssemblyDefinitionFor (System.String path) [0x00001] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    41.   at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.get_AssemblyDefinition () [0x00013] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    42.   at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.CollectAllInternalCalls () [0x00008] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    43.   at Unity.InternalCallRegistrationWriter.Collector.InternalCallCollector.get_InternalCallsByType () [0x0000e] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    44.   at Unity.InternalCallRegistrationWriter.Runner.DefaultRunner.Run (Unity.InternalCallRegistrationWriter.Runner.InternalCallOptions options) [0x00022] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    45.   at Unity.InternalCallRegistrationWriter.Runner.DefaultRunner.ParseOptionsAndRun (System.String[] args) [0x00008] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    46.   at Unity.InternalCallRegistrationWriter.Program.Main (System.String[] args) [0x00001] in <0d3380eb5a25466c9471bc2ee62bbd90>:0
    47. 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 :)

    I will try to rebuild skia native to make sure that I can create a working example of skfonts rendering
     
    Last edited: Dec 16, 2021
  18. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,593
    yeh works for me, didnt even need full stacktrace, thanks.
     
  19. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    @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:
    Screenshot 2022-01-14 at 00.04.57.png

    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.
     
    Last edited: Jan 13, 2022
  20. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    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

    Screenshot 2022-01-14 at 01.26.02.png

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

    https://github.com/dr-vij/SkiaSharpForUnity
     
    Last edited: Jan 13, 2022
    Qhuhuit likes this.
  21. MarcelPursche

    MarcelPursche

    Unity Technologies

    Joined:
    Mar 3, 2021
    Posts:
    44
    Hi,

    I investigated a bit further into the issue now and I think it could be to certain emscripten compiler settings that are used in Non-Development builds vs. the compiler settings used to build "libSkiaSharp.a". I want to try to compile "libSkiaSharp.a" with different compiler settings to see if can make it work in Non-Development builds but I wasn't able to build it on my machine. I found your question on the SkiaSharp GitHub: https://github.com/mono/SkiaSharp/issues/1844 Can you tell me what you did to compile it for wasm without 'libjpegturbo" linked into the output?
     
    DrViJ likes this.
  22. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    Hi! of course, I can, and thank you so much for investigation of this problem! I will write the instructions of how to build it in next post.
     
  23. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
  24. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    148
    Hey I am having this issue - how do i see where the issue lies ? - standalone works fine - webgl throws the exception thrown: RuntimeError: indirect call signature mismatch error - tried different settings like exception with no stack trace - with stack trace no exception - clearing the library and relaunching - cleaning the build then rebuilding..same error
     
  25. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    148
    reverted to 2020 resolved the issue - which kinda sucks - but ill leave it on an LTS for now​
     
    ina likes this.
  26. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    @MarcelPursche, Hi! Sorry for bumping this thread, but could you tell if there are any news about this bug? Could you maybe tell what are emscripten args differences between development and nondevelopment in Unity 2021.2/2022.1? I can try rebuild skia native libraries myself to make them work
     
  27. jackcrosa

    jackcrosa

    Joined:
    Oct 16, 2012
    Posts:
    22
    Encoutering the same issue with 2021.2.9f1
     
    DrViJ and Neto_Kokku like this.
  28. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    @MarcelPursche, I tried to change build settings of skia native, and it worked in 2021.2

    the settings in cake are:
    $"skia_enable_fontmgr_custom_directory=false " +
    $"skia_enable_fontmgr_custom_empty=true " +
    $"skia_enable_fontmgr_custom_embedded=false " +
    $"skia_enable_fontmgr_empty=true " +

    I will try to investigate it and upload the results on github. Everything works if freetype is not linked to the library :(
     
    Last edited: Mar 25, 2022
  29. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
  30. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    @JoshPeterson Hello, don't you know, is there any news about this bug? I can provide arguments and instructions how the library was built. Or maybe can I get information about what args does Unity use when wasm is built?
     
  31. MarcelPursche

    MarcelPursche

    Unity Technologies

    Joined:
    Mar 3, 2021
    Posts:
    44
    Hi!

    Sorry for not answering for a while. I have found something that might help to track down the root cause.
    Could you try using the "-Wbad-function-cast -Wcast-function-type" compiler options (https://github.com/emscripten-core/emscripten/issues/16126#issuecomment-1023067658) when compiling the skia native static library and the depended libraries?
    If the issue is caused by a bad function pointer cast we can track it down this way.
     
    DrViJ likes this.
  32. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    Hi! I have tried to build with these extra flags have not noticed any warnings at library build.

    Thats how does the new config look like:
    $"extra_cflags_cc=[ '-frtti', '-Wbad-function-cast', '-Wcast-function-type']"+
     
  33. MarcelPursche

    MarcelPursche

    Unity Technologies

    Joined:
    Mar 3, 2021
    Posts:
    44
    Hi!

    Are you using a prebuild version of libfreetype? Or is it compiled by the skin build script with the same compiler flags?
     
  34. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    It is compiled with skianative with the same compiler as I know, I looked in ninja files and cake files and I see that it is build together and included in one .a library
     
  35. leonhogan1

    leonhogan1

    Joined:
    Apr 21, 2020
    Posts:
    13
    Hey, im getting this issue as well. Has there been any updates on its reolutions?
     
    ina likes this.
  36. unity_0584541ECE5746C67E6D

    unity_0584541ECE5746C67E6D

    Joined:
    May 13, 2022
    Posts:
    1
    Also getting this issue, any solutions???
     
  37. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    100
    We're seeing this error too. Following the solution here, changing Speed to Size, seems to fix the issue, but it also increases our build sizes, so it's less than ideal for webgl.
     
    Last edited: Jun 30, 2022
  38. em7999

    em7999

    Joined:
    Jan 18, 2020
    Posts:
    1
    Cache may be one of the reasons. Try clear browsing data.
     
  39. GertCoppens

    GertCoppens

    Joined:
    May 2, 2018
    Posts:
    12
    Any updates?
     
  40. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    Unfortunately they closed my bug as Won't Do, I got the message that emscripten version may change from version to version and my version (the same as that unity version) is not correct anymore. So I decided to write my drawing api myself, without skia wasm.
     
    GertCoppens likes this.
  41. Chingachi

    Chingachi

    Joined:
    Jan 28, 2022
    Posts:
    1

    Perhaps this might help. I used to get a null function, too. But in my case a static Action was used without checking it for null. So I called it as follows: "Action(arguments)" instead of "Actiion?.Invoke(arguments)".
     
  42. dimorin

    dimorin

    Joined:
    Oct 2, 2022
    Posts:
    1
    I have solved this issue by deleting browser cache. Ctrl + Shift + Delete
     
  43. leonhogan1

    leonhogan1

    Joined:
    Apr 21, 2020
    Posts:
    13
    Still getting this error, clearing browser cache did not fix error
     
  44. DemVD

    DemVD

    Joined:
    Nov 21, 2022
    Posts:
    3
    Getting this error from release WebGL build. Clearing browser cache did fix it, but this is not ideal. Happened on two seperate devices already. The game im writing is for kids, and if this occurs again in their browsers, they won't know how to fix it. Any solutions long term?
     
  45. hamik166

    hamik166

    Joined:
    Oct 19, 2019
    Posts:
    31
    There is no solution, it's a bug in unity and they can't fix it, you can do nothing if even the developer of the engine gave up
     
    DrViJ likes this.
  46. Zoltan-ferenczfi

    Zoltan-ferenczfi

    Joined:
    Dec 16, 2015
    Posts:
    1
    Hi All,

    Would that be somehow possible at least to catch this event / detect this situation somehow?
    As this happens when the build is being loaded, so the app itself cant detect it, as it cannot even launch.
    The only thing I see is the error in the browser's console, but as far as I know, I cant read the browser's console at all with JS or with anything else. (only with my own eyes if I open the developer console window in the browser)
    I am just wondering, if the Unity JS, that loads the WEBGL build, which probably throws this exception would be able to realise this and take some action.
    For example: I would implement a simple pop up window, asking the user to reload the page, close the browser and open it back, etc ... anything would be better, than that the loading process simply stops and that's it ...

    Thx for your feedback!
     
  47. akuz0

    akuz0

    Joined:
    Dec 13, 2022
    Posts:
    2
    no have solution?
     
  48. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    154
    I am sorry guys, but we all are talking about different bugs and situations. My bug was about compiling C++ library (Skia Sharp) to native .a plugin used inside unity wasm build, and my problem was about changes in emscripten in different unity versions. So we all are talking about different bugs/problems with same symptoms in webgl build: signature mismatch, but the reasons of these bugs are different because of different reproduction sceneries. I think you should create separate forum threads for your problems and bump somebody from Unity, cause I think Unity team knows that my bug is closed as won't do/by design and won't help here.
     
    Last edited: Jan 27, 2023
    h0neyp0t likes this.
  49. DNWorks

    DNWorks

    Joined:
    Jan 30, 2023
    Posts:
    2
    Hello, I have a similar error, I do not know what to do with it. I have no idea about solving this error because I am just starting to develop Unity games. Maybe you can tell me how to solve it? In unity, the game works, but in the browser, when passing all 30 levels, it should be moved to the level selection menu, however, this error pops up and if you refresh the page, the game will no longer work when you click on the game launch button and the same window with the error name will be displayed. I have the latest version of unity 2021 installed
     

    Attached Files:

    h0neyp0t likes this.
  50. DNWorks

    DNWorks

    Joined:
    Jan 30, 2023
    Posts:
    2
    Hello, do you know how to solve my similar error? I don't know how solve this((