WalletConnect / WalletConnectUnity

[DEPRECATED] WalletConnect v2 and Modal for Unity 🎮
MIT License
152 stars 49 forks source link

Cannot build for WebGL #183

Closed deroude closed 7 months ago

deroude commented 7 months ago

Describe the bug

A simple hello world project including the WalletConnectModalSample fails to build for WebGL

To Reproduce

This is the sample project: https://github.com/deroude/wallet-connect-unity-sample

Build for WebGL, the following errors appear:

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(230,28): error CS0535: 'WebSocket' does not implement interface member 'IDisposable.Dispose()'

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(714,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(714,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(717,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(717,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(233,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(233,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(720,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(720,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(236,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(236,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(723,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(723,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(239,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(239,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(726,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(726,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(242,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(242,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(729,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(729,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(245,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(245,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(732,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(732,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(764,6): error CS0246: The type or namespace name 'MonoPInvokeCallbackAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(764,6): error CS0246: The type or namespace name 'MonoPInvokeCallback' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(775,6): error CS0246: The type or namespace name 'MonoPInvokeCallbackAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(775,6): error CS0246: The type or namespace name 'MonoPInvokeCallback' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(789,6): error CS0246: The type or namespace name 'MonoPInvokeCallbackAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(789,6): error CS0246: The type or namespace name 'MonoPInvokeCallback' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(803,6): error CS0246: The type or namespace name 'MonoPInvokeCallbackAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.walletconnect.core@3.1.0\Runtime\External\NativeWebSocket\WebSocket.cs(803,6): error CS0246: The type or namespace name 'MonoPInvokeCallback' could not be found (are you missing a using directive or an assembly reference?)

Error building Player because scripts had compiler errors

Expected behavior

The project should build on WebGL

Environment

Is this happening in Unity Editor or on a player like Android, iOS, Windows?

Unity Editor, when building

Wallets used for testing

N/A

skibitsky commented 7 months ago

Hello, @deroude, thank you for reporting the issue!

It has been fixed in the latest release.

Please also pay attention to the readme section about the additional package that you will need to manually install to enable WebGL support.

deroude commented 7 months ago

Hi @skibitsky -- thanks for the update, worked like a charm!