socketio / socket.io-client-java

Full-featured Socket.IO Client Library for Java, which is compatible with Socket.IO v1.0 and later.
https://socketio.github.io/socket.io-client-java/installation.html
Other
5.31k stars 969 forks source link

Android 11.0 (API30 ) app crashing with error: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 at com.arriyam.countersocketandroid.MainActivity.onCreate$lambda-0(MainActivity.kt:17) #720

Open testGumar opened 1 year ago

testGumar commented 1 year ago

Describe the bug Socket is being connected at the same time app is getting crashed at (even try block is not able to catch it)

To Reproduce 2022-09-29 20:14:37.069 24427-24464/com.arriyam.countersocketandroid E/EventThread: Task threw exception java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 at com.arriyam.countersocketandroid.MainActivity.onCreate$lambda-0(MainActivity.kt:17)

code is in kotlin android fun setSocket() { try { mSocket = IO.socket("http://10.0.2.2:3000") } catch (e: URISyntaxException) { Log.e("TAG", "URISyntaxException") } } Expected behavior

Platform:

Additional context Add any other context about the problem here.