• Unity WebGL 编译 报错: emcc2: error: ‘*‘ failed: [WinError 2] ϵͳ�Ҳ���ָ�����ļ���解决办法


    错误日志

    Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output:
    emcc2: error: '"C:/Program Files/Unity/Hub/Editor/2021.3.6f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/binaryen\bin\wasm-metadce" --graph-file=C:\Temp\tmp8sp_k84m.txt Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.wasm -o Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.wasm --mvp-features' failed: [WinError 2] ϵͳ�Ҳ���ָ�����ļ���
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    
    BuildFailedException: Incremental Player build failed!
    UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
    UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:158)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    
    Build completed with a result of 'Failed' in 128 seconds (128027 ms)
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    
    UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
      at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <44a70d1b13cf47e29810e30f45ffae08>:0 
      at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <44a70d1b13cf47e29810e30f45ffae08>:0 
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    可能的原因及解决办法:

    导出路径不能有中文

    系统名(win)含有中文, 修改环境变量Temp和Tmp, 如下图:

    修改环境变量

    真正的原因: 杀毒软件删除了部分wasm相关文件,如:

    */Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/binaryen/bin/wasm-metadce.exe
    */Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/binaryen/bin/wasm-emscripten-finalize.exe
    
    • 1
    • 2

    解决办法(二选一):

    1. 找到文件并还原到原位置
    2. 重装Editor
  • 相关阅读:
    R数据分析:解决科研中的“可重复危机”,理解Rmarkdown
    2024清理mac苹果电脑内存免费工具CleanMyMac X4.15
    核货宝:连锁电商集采集供解决方案
    Bit.Store:熊市漫漫,稳定Staking产品或成主旋律
    面试官:ElasticSearch是什么,它有什么特性与使用场景?
    【教3妹学算法-每日1题】生成每种字符都是奇数个的字符串
    备赛笔记:RCNN网络基础
    wallet connect简单使用
    常用Win32 API的简单介绍
    2023上半年软考系统分析师科目一整理-02
  • 原文地址:https://blog.csdn.net/Dekiven/article/details/132986937