<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>WebGL on uBug Blog</title><link>https://ubug.cc/tags/webgl/</link><description>Recent content in WebGL on uBug Blog</description><generator>Hugo -- 0.148.0</generator><language>zh</language><lastBuildDate>Wed, 21 Jan 2026 00:51:00 +0800</lastBuildDate><atom:link href="https://ubug.cc/tags/webgl/index.xml" rel="self" type="application/rss+xml"/><item><title>奇怪的修复 Unity WebGL 打包失败方法</title><link>https://ubug.cc/posts/tech/unitybuildwebglappfailissuefix/</link><pubDate>Thu, 15 Jan 2026 23:56:18 +0800</pubDate><guid>https://ubug.cc/posts/tech/unitybuildwebglappfailissuefix/</guid><description>&lt;blockquote>
&lt;p>先说结论，关闭了XMP解决了Unity构建WebGL失败的问题，但我没有理解原因。&lt;/p>&lt;/blockquote>
&lt;p>昨晚尝试在公司的电脑上使用Unity 6000.0.40f1 上构建一个WebGL应用失败。&lt;/p>
&lt;p>出现错误&lt;/p>
&lt;div class="highlight">&lt;div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
&lt;table style="border-spacing:0;padding:0;margin:0;border:0;">&lt;tr>&lt;td style="vertical-align:top;padding:0;margin:0;border:0;">
&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code>&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
&lt;/span>&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
&lt;/span>&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
&lt;/span>&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4
&lt;/span>&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>C:\Users\***\UnityProject\***&amp;gt;set MYDIR=C:\Program Files\Unity\Hub\Editor\6000.0.40f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>C:\Users\***\UnityProject\***&amp;gt;goto FOUND_MYDIR emcc: error: &amp;#39;&amp;#34;C:/Program Files/Unity/Hub/Editor/6000.0.40f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/binaryen\bin\wasm-opt&amp;#34; --strip-dwarf --signext-lowering --post-emscripten -O2 --low-memory-unused --zero-filled-memory --pass-arg=directize-initial-contents-immutable --strip-debug --strip-producers Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.wasm -o Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.wasm --mvp-features --enable-mutable-globals --enable-sign-ext&amp;#39; failed (returned 3221225477) UnityEditor.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>EditorApplication:Internal_CallDelayFunctions ()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>很奇怪，记得之前是可以正常构建WebGL app的。&lt;/p>
&lt;p>不想思考，将报错信息交给ChatGPT。&lt;/p>
&lt;p>根据ai反馈的可能原因逐一进行排查。&lt;/p>
&lt;ol>
&lt;li>
&lt;p>删除缓存重试&lt;/p>
&lt;p>删除项目下Library目录整体，重启Unity重新生成，没用。&lt;/p>
&lt;/li>
&lt;li>
&lt;p>杀毒软件防护/干扰&lt;/p>
&lt;p>这点排除，我的工作电脑只有windows defender。&lt;/p>
&lt;/li>
&lt;li>
&lt;p>重装 WebGL Support Build&lt;/p></description></item></channel></rss>