Closed wout-junius closed 1 year ago
I don't have a Quest 2 device to test, here is some suggestions for some potential solutions:
Add the required permissions to the AndroidManifest.xml file to allow internet and network access. This can be done by adding the following lines:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
You can refer to this Stack Overflow post for more information.
In Unity, go to Edit -> Project Settings -> Player and select the Android platform. Then, navigate to the Build Settings and change the Internet Access setting from "Auto" to "Require".
Check if the issue is related to the server or network setup. For example, try using the machine/server's IP address instead of "localhost", or check if there is any firewall or security settings on the network that might be blocking the connection. If so, try to allow the client's (Quest 2) IP address or MAC address.
Review any error messages or logs for more information on the problem.
I fixed it by setting the build settings in unity in IL2CPP from Faster runtime
to Faster (Smaller) builds
.
This caused the issue to disappear. probably some weird converting that happened in one but not the other.
When we run our socket IO connection on the Unity editor the connection perfecly works and we are connected. But when we build and run the exact same code to Android (Quest runs on Android) it does not connect. Strangly the server gets a get request when it tries to connects but no connection is made.
Wrapper code: