Xamarin Forms application error java.lang.ArrayIndexOutOfBoundsException : Index 4 out of bounds for length 4

teja 16 Reputation points
2022-04-04T12:12:29.683+00:00

I'm getting the below error in VS2022 when trying to debug a Xamarin Forms app on Android emulator.
The same works on VS2019 with the same sdk.

java.lang.ArrayIndexOutOfBoundsException : Index 4 out of bounds for length 189664-capture.png

Developer technologies .NET Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-04-05T02:21:31.577+00:00

    Hello,

    Based on your description, this issue is related to the r8.jar, and this issue is reported in the GitHub.

    https://github.com/xamarin/xamarin-android/issues/6632

    You can try one of these newer builds. If this issue will disappear.

    Mac: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/5661586/main/5762b45d1f1f8cd894dc7616f05c83447ef895bd/xamarin.android-12.2.99.52.pkg
    Windows: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/5661586/main/5762b45d1f1f8cd894dc7616f05c83447ef895bd/Xamarin.Android.Sdk-12.2.99.52.vsix

    Best Regards,
    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.