EnoxSoftware / OpenCVForUnity

OpenCV for Unity (Untiy Asset Plugin)
https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088
557 stars 175 forks source link

WebGL build failed with development build enabled #133

Closed mbaranovskyi closed 2 years ago

mbaranovskyi commented 2 years ago

Unity versions: 2020.3 lts, 2021.1 OpenCV version 2.4.6

`Failed running python2 -E "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc" @"/Users/mbaranovskyi/Downloads/Udistortion/Assets/../Temp/emcc_arguments.resp"

stdout: stderr:WARNING:root:object /private/var/folders/jh/4wqr_jjd7f9561d8j2q4g17w0000gn/T/emscripten_temp_rh6gPu_archive_contents/all_opencvforunity.bc is not valid according to llvm-nm, cannot link[0;33mwarning:[0m unexpected number of arguments 1 in call to '__cxa_pure_virtual', should be 0[0;33mwarning:[0m unexpected number of arguments 2 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0[0;33mwarning:[0m unexpected number of arguments 4 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0[0;33mwarning:[0m unexpected number of arguments 5 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0[0;33mwarning:[0m unexpected number of arguments 4 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0[0;33mwarning:[0m unexpected number of arguments 2 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0[0;33mwarning:[0m unexpected number of arguments 3 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0error: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100414ScaleLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100414ShiftLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100416EltwiseLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100416PoolingLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100416SoftmaxLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100418BatchNormLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100419ActivationLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100420ConvolutionLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100421InnerProductLayerInt86createERKNS1_11LayerParamsEAborting compilation due to previous errors | undefinedTraceback (most recent call last): File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc.py", line 3063, in sys.exit(run()) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc.py", line 1780, in run final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/tools/shared.py", line 2274, in emscripten emscripten._main(cmdline) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 2233, in _main return temp_files.run_and_clean(lambda: main( File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/tools/tempfiles.py", line 93, in run_and_clean return func() File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 2238, in DEBUG=DEBUG, File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 2164, in main temp_files=temp_files, DEBUG=DEBUG) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 86, in emscript glue, forwarded_data = compiler_glue(metadata, libraries, compiler_engine, temp_files, DEBUG) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 218, in compiler_glue glue, forwarded_data = compile_settings(compiler_engine, libraries, temp_files) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 541, in compile_settings cwd=path_from_root('src'), error_limit=300) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/tools/jsrun.py", line 132, in run_js raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])Exception: Expected the command ['/Applications/Unity/Hub/Editor/2020.3.4f1/Unity.app/Contents/Tools/nodejs/bin/node', '--stack_size=8192', '--max-old-space-size=4096', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/src/compiler.js', '/tmp/tmpbvzgjG.txt', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Audio.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Cursor.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Eval.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/FileSystem.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Logging.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Profiler.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/SystemInfo.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/UnetWebSocket.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Video.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/WebCam.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/WebRequest.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/case_1174367_workaround.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/case_1179945_workaround.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/case_1187965_workaround.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/src/library_pthread_stub.js'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import// and export values on it. There are various ways Module can be used:// 1. Not defined. We create it here// 2. A function parameter, function(Module) { ..generated code.. }// 3. pre-run appended it, var Module = {}; ..generated`

EnoxSoftware commented 2 years ago

Thank you very much for reporting.

Could you ensure that ImportSettings in "Plugins/WebGL/2019.1/opencvforunity.bc" is set as follows? MenuItem

webgl2019 1_importsettings

Regards, EnoxSoftware

mbaranovskyi commented 2 years ago

Thanks for the fast answer! Yeah, it is set as on the screen

EnoxSoftware commented 2 years ago

"Assets\OpenCVForUnity\Plugins\WebGL\2021.2\opencvforunity.bc" had the wrong file name and the correct ImportSettings were not set. Could you rename opencvforuntiy.bc to opencvforunity.bc and run "Set Plulgin Import Settings" ?

OpenCV_WebGL_ImportSettings2019 1 OpenCV_WebGL_ImportSettings2021 2

I've uploaded the modified package to AssetStore.

mbaranovskyi commented 2 years ago

I have updated plugin double-checked that names now is okay but still doesnt build with that log `Failed running python2 -E "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc" @"/Users/mbaranovskyi/Downloads/Udistortion/Assets/../Temp/emcc_arguments.resp"

stdout: stderr:warning: unexpected number of arguments 1 in call to '__cxa_pure_virtual', should be 0warning: unexpected number of arguments 2 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0warning: unexpected number of arguments 4 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0warning: unexpected number of arguments 5 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0warning: unexpected number of arguments 4 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0warning: unexpected number of arguments 2 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0warning: unexpected number of arguments 3 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0error: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100414ScaleLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100414ShiftLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100416EltwiseLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100416PoolingLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100416SoftmaxLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100418BatchNormLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100419ActivationLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100420ConvolutionLayerInt86createERKNS1_11LayerParamsEerror: unresolved symbol: _ZN2cv3dnn14dnn4_v2021100421InnerProductLayerInt86createERKNS1_11LayerParamsEAborting compilation due to previous errors | undefinedTraceback (most recent call last): File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc.py", line 3063, in sys.exit(run()) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc.py", line 1780, in run final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/tools/shared.py", line 2274, in emscripten emscripten._main(cmdline) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 2233, in _main return temp_files.run_and_clean(lambda: main( File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/tools/tempfiles.py", line 93, in run_and_clean return func() File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 2238, in DEBUG=DEBUG, File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 2164, in main temp_files=temp_files, DEBUG=DEBUG) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 86, in emscript glue, forwarded_data = compiler_glue(metadata, libraries, compiler_engine, temp_files, DEBUG) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 218, in compiler_glue glue, forwarded_data = compile_settings(compiler_engine, libraries, temp_files) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten.py", line 541, in compile_settings cwd=path_from_root('src'), error_limit=300) File "/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/tools/jsrun.py", line 132, in run_js raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])Exception: Expected the command ['/Applications/Unity/Hub/Editor/2020.3.4f1/Unity.app/Contents/Tools/nodejs/bin/node', '--stack_size=8192', '--max-old-space-size=4096', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/src/compiler.js', '/tmp/tmpOXQtX9.txt', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Audio.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Cursor.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Eval.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/FileSystem.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Logging.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Profiler.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/SystemInfo.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/UnetWebSocket.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/Video.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/WebCam.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/WebRequest.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/case_1174367_workaround.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/case_1179945_workaround.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/lib/case_1187965_workaround.js', '/Applications/Unity/Hub/Editor/2020.3.4f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/src/library_pthread_stub.js'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import// and export values on it. There are various ways Module can be used:// 1. Not defined. We create it here// 2. A function parameter, function(Module) { ..generated code.. }// 3. pre-run appended it, var Module = {}; ..generated UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)`

EnoxSoftware commented 2 years ago

In my environment, the build was successful without any problems. Unity2020.3.4f1 macOS 10.15.7 One of the possibilities for build errors is that there may not be enough space left on the HDD.

output.zip

fisheye
mbaranovskyi commented 2 years ago

I have tried on different environments and different unities versions, different OSs but have same error dor the Development build. As i can see output, you provided, is from release build, but i can build release build, have problems only with development one

EnoxSoftware commented 2 years ago

I was able to reproduce the build error in my environment. I am currently investigating the cause of the error.

EnoxSoftware commented 2 years ago

For Unity2021.2 and above, the Development Build does not seem to generate any errors.

mbaranovskyi commented 2 years ago

but It would be much better to fix it for 2020 LTS also

mbaranovskyi commented 2 years ago

Will this issue be fixed? have you any ETA for this?

mbaranovskyi commented 2 years ago

@EnoxSoftware ping

EnoxSoftware commented 2 years ago

I've uploaded a version that fixes this issue, could you re-download it from AssetStore?

mbaranovskyi commented 2 years ago

Thanks it has been fixed