unity2d转微信小程序报错

报错

在这里插入图片描述
Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output:
Traceback (most recent call last):
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\emcc2.py”, line 3571, in
sys.exit(main(sys.argv))
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\emcc2.py”, line 3564, in main
ret = run(args)
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\emcc2.py”, line 1082, in run
phase_post_link(options, wasm_target, wasm_target, target)
File “D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\contextlib.py”, line 74, in inner
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\emcc2.py”, line 2400, in phase_post_link
phase_emscript(options, in_wasm, wasm_target, memfile)
File “D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\contextlib.py”, line 74, in inner
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\emcc2.py”, line 2428, in phase_emscript
emscripten.run(in_wasm, wasm_target, final_js, memfile)
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\emscripten.py”, line 830, in run
emscript(in_wasm, out_wasm, outfile_js, memfile, shared.DEBUG)
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\emscripten.py”, line 308, in emscript
glue, forwarded_data = compile_settings()
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\emscripten.py”, line 178, in compile_settings
cwd=path_from_root(‘src’), env=env)
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\tools\shared.py”, line 216, in run_js_tool
return check_call(command, *args, **kw).stdout
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\tools\shared.py”, line 202, in check_call
return run_process(cmd, *args, **kw)
File “D:\Unity\2021.3.4f1c1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\tools\shared.py”, line 97, in run_process
ret = subprocess.run(cmd, check=check, input=input, *args, **kw)
File “D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py”, line 474, in run
File “D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py”, line 926, in communicate
UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa4 in position 471314: illegal multibyte sequence
UnityEditor.BuildPipeline:BuildPlayer (string[],string,UnityEditor.BuildTarget,UnityEditor.BuildOptions)
WeChatWASM.WXEditorWindow:Build () (at Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs:343)
WeChatWASM.WXEditorWindow:DoExport (bool) (at Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs:1331)
WeChatWASM.WXEditorWindow:OnGUI () (at Assets/WX-WASM-SDK/Editor/WXEditorWindow.cs:1259)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

原因

打包前插件提示可以更新,于是在并未卸载20220915版本的前提下,直接导入了20220923版本
unity2d转微信小程序报错_第1张图片

解决方法

在项目目录/Assets/下,找到WX-WASM-SDK删掉。然后重新导入工具包,此处我导入的是原来那个版本,并未导入下载的新版本
unity2d转微信小程序报错_第2张图片

你可能感兴趣的:(unity,报错处理,微信小程序,unity,小程序)