Skip to content

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

Description

@testGumar

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:

  • Device: [e.g. Samsung S8] Android Studio latest
  • OS: [e.g. Android 9.2] Android 11 api 30+

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions