Closed natsoragge closed 12 months ago
I can offer a quick workaround, which will stub out those functions in the WebGL build so that the build will not fail.
MicrosoftGeospatialDecompressionStubs.cpp
file in the package:
Now the WebGL build should work.
Note however, there will be unnecessary compilation and size overhead in the build output due to the maps code. Also, this does not make the map functional in webgl, so if the map code is being called it could lead to errors.
A better approach to ensure the map code is not compiling into the WebGL build output could be to put the map-related objects into a separate scene, and then exclude that scene for the WebGL build... At least, that's one idea. There may be better ways to go about that, but the gist is to make sure that the maps code is not being referenced by a scene when building WebGL.
Thanks for the answer! I was able to get rid of the errors by using the '-s ERROR_ON_UNDEFINED_SYMBOLS=0' argument. For those who might have the same problem:
webGLEmscriptenArgs: -s ERROR_ON_UNDEFINED_SYMBOLS=0
That solved the issue for me. Creating the ghost WebGL plugin would probably also work, but in my case this solution fitted better.
Describe the bug I have a Unity project that supports multiple platforms. We use the Maps SDK for Android and Standalone, but the project can also be built to WebGL, even though the maps functionality is disabled in this platform. Since I upgraded Unity to 2022, the WebGL build stopped working and I get the following errors:
I know the SDK does not support WebGL, but it shouldn't block WebGL builds.
To Reproduce Steps to reproduce the behavior:
Expected behavior The build should work
Screenshots
Environment (please complete the following information):
Additional context Excluding WebGL from the Runtime asmdef and from Microsoft.Maps.Unity.dll's target platforms seems to fix the build issue, but cause errors in runtime