Unity WebGL仅在非开发模式下构建错误

时间:2018-06-15 08:52:40

标签: unity3d unity-webgl

我正在使用Unity 2017.3.03f免费个人版,我的团结应用程序在桌面和Android平台上正常运行。但是,当它为WebGL版本(未选中“开发构建”选项“)构建时,它会在加载启动画面期间在浏览器中显示此错误:

> An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
uncaught exception: abort(-1) at jsStackTrace (webgl-11B.asm.framework.unityweb:2:27460)
stackTrace (webgl-11B.asm.framework.unityweb:2:27631)
abort (webgl-11B.asm.framework.unityweb:4:33732)
_il2cpp_gc_disable (webgl-11B.asm.framework.unityweb:2:204426)
scripting_gc_disable() [vNc] (webgl-11B.asm.code.unityweb:10:1)
_main [eNc] (webgl-11B.asm.code.unityweb:10:1)
callMain (webgl-11B.asm.framework.unityweb:4:32097)
doRun (webgl-11B.asm.framework.unityweb:4:32800)
_String_Join_m2050845953 [run] (webgl-11B.asm.framework.unityweb:4:32986)
runCaller (webgl-11B.asm.framework.unityweb:4:31614)
removeRunDependency (webgl-11B.asm.framework.unityweb:2:34407)
processDataJob@file:.../Build/UnityLoader.js:1:17079

我尝试启用开发选项并应用本文的步骤: https://community.gamedev.tv/t/webgl-debugging/54948

启用调试符号并禁用剥离代码引擎以查看浏览器控制台中的错误但是开发版本可以正常运行,但是当我再次发布版本“取消选中开发选项”时,会出现相同的错误。

并且浏览器控制台的日志包含以下消息:

> IndexedDB is not available. Data will not persist in cache and PlayerPrefs will not be saved.
a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:124
unreachable code after return statement[Learn More]
a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:4519
missing function: il2cpp_gc_disable
UnityLoader.js:1:8039
-1
UnityLoader.js:1:8002
-1
UnityLoader.js:1:8039
Use of the motion sensor is deprecated.
a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:54097
Use of the orientation sensor is deprecated.
a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:54097
uncaught exception: abort(-1) at jsStackTrace@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:27460
stackTrace@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:27631
abort@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:33732
_il2cpp_gc_disable@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:204426
vNc@blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:10:1
eNc@blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:10:1
callMain@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:32097
doRun@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:32800
run@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:32986
runCaller@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:31614
removeRunDependency@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:34407
processDataJob.../UnityLoader.js:1:17079
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
154
UnityLoader.js:1:8002
154
UnityLoader.js:1:8039
uncaught exception: abort(154) at jsStackTrace@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:27460
stackTrace@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:27631
abort@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:33732
Vxq@blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:32:1
y7c@blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:23:1
ynq@blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:32:1
handlerFunc@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:57395
jsEventHandler@blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:53935

为什么会发生这种错误?是因为使用统一免费版,还是因为应用程序在加载时从资源文件夹中读取了一些文本文件

提前感谢。

0 个答案:

没有答案