Showing out of bound error in the app

I’m sharing the github repo along with the error

java.lang.ArrayIndexOutOfBoundsException: length=6; index=-

In Crop.kt
you need to get the random value under a specific range i.e, 0-5

To do so you can use.

Random.nextInt(min, max+1)

which in your case would be

Randon.nextInt(0,6)

This will solve the above error but the app still crashes as the code is not complete yet.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.