NativeWebSocket icon indicating copy to clipboard operation
NativeWebSocket copied to clipboard

Websocket wss not connect build android

Open ramaha1565 opened this issue 5 years ago • 5 comments

when I build for android the websocket does not want to connect, although it works fine on the pc

ramaha1565 avatar Sep 21 '20 19:09 ramaha1565

I have the same issue with wss. It works finr on pc but not in android build

duchuy413 avatar Oct 12 '20 17:10 duchuy413

I have exactly the same problem with websockets during a "normal" Android build. The error is as below:

Normal build:

10-21 16:54:57.540 18662 20335 E Unity   : Unable to find advapi32
10-21 16:54:57.790 18662 20335 I Unity   : Error! Unable to connect to the remote server

But.... when building a "development build" for Android, the entire application is working, though with still the same error not able to find advapi32. Anyone have a clue why development build is different in this sense?

Development build:

10-21 16:55:49.885 18663 20518 D Unity   : Failed to load native plugin: Unable to lookup library path for 'advapi32'.
10-21 16:55:49.886 18663 20518 E Unity   : Unable to find advapi32
10-21 16:55:50.407 18663 20518 I Unity   : Connection open!

ntilborg avatar Oct 21 '20 15:10 ntilborg

I have the exact same issues with @ntilborg , will be very happy if someone or devs can provide a solution.

Shorino avatar Feb 10 '21 12:02 Shorino

If your client is some kind of platform that can't dynamically look up certificates (e.g. Unity on Android apparently?), unity-tlsexception-handshake-failed-unitytls-x509verify-flag-not-trusted might be the issue. I had this issue when using Letsencrypt for my server. I fixed the problem by using fullchain.pem instead of cert.pem.

elmisback avatar Jun 08 '21 17:06 elmisback

Try this. Player Settings -> Other Settings ->Internet Access = Requiere. and build.

some info. on Developmnet build unity add '<uses-permission android:name="android.permission.INTERNET />' but normal build unity does not add internet permition. https://stackoverflow.com/questions/38894013/unity-app-works-on-development-build-not-on-normal-one

devwithu avatar Nov 22 '21 02:11 devwithu