opentok / opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
https://tokbox.com/developer/sdks/android/
MIT License
210 stars 169 forks source link

java.lang.IndexOutOfBoundsException at contentView.draw(canvas) #446

Closed kundanthe closed 1 year ago

kundanthe commented 1 year ago

Describe the bug Crashing app when sharing screen in android.

To Reproduce Steps to reproduce the behavior: View view = getCurrentActivity().getWindow().getDecorView().getRootView(); OTScreenCapturer capturer = new OTScreenCapturer(view);

Exception coming in OTScreenCapturer and I am changing the screen frequently on mobile side.

Expected behavior java.lang.IndexOutOfBoundsException: Index: 2, Size: 0 at java.util.ArrayList.get(ArrayList.java:437) at android.view.ViewGroup.getAndVerifyPreorderedView(ViewGroup.java:3624) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4110) at android.view.View.draw(View.java:20075) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.draw(View.java:20075) at android.view.ViewGroup.drawChild(ViewGroup.java:4333)

Device (please compete the following information):

Additional context This exception we are getting on OTScreenCapture file at the given below line.
 contentView.draw(canvas);

kundanthe commented 1 year ago

Hi , Anyone has got the chance to review this...?

devwithzachary commented 1 year ago

Hello, have you tried updating to the latest version of the SDK (2.24.1) 

If you get the same issue in the latest version can you please send the complete logcat dump for the error? Thanks!

kundanthe commented 1 year ago

Hi @devwithzachary

Thank you for you revert, I am getting same trace on this sdk also. And Its not related to sdk I guess.

v-kpheng commented 1 year ago

Thanks, @kundanthe for the update. Closing, since it's not related to SDK.