Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get the following error for some reason. #10

Open
Achisyg2 opened this issue Sep 11, 2022 · 5 comments
Open

I get the following error for some reason. #10

Achisyg2 opened this issue Sep 11, 2022 · 5 comments
Labels
question Further information is requested

Comments

@Achisyg2
Copy link

Describe the bug
Everything else is working perfect. However, when I scroll faster on the recyclerview I get the following error:
java.lang.ArrayIndexOutOfBoundsException: length=5; index=5 at com.app.selfcial.Adapters.PostsAdapter$7.onComplete(PostsAdapter.java:592) at com.google.android.gms.tasks.zzi.run(com.google.android.gms:play-services-tasks@@18.0.1:1) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

To Reproduce
Steps to reproduce the behavior:

  1. Click on a reaction
  2. Save it in Firebase with reaction id
  3. setCurrentReaction based on the saved id
  4. Scroll a bit bit faster the recyelerview

Expected behavior
It should work same as when scrolling slow

Smartphone (please complete the following information):

  • Device: Xiaomi Redmi 8
  • OS: Android 10
@AmrDeveloper
Copy link
Owner

Hello @Achisyg2,

Thanks for your report,

java.lang.ArrayIndexOutOfBoundsException: length=5; index=5 at

Can you please provide some more information for example how many reactions you used? I think they are 5

what is the reaction index for the post that case the problem? try to print them in log before crash

@Achisyg2
Copy link
Author

@AmrDeveloper I can't because after the error occurs one time then the app crashes every time I open it.

@AmrDeveloper
Copy link
Owner

@Achisyg2 This means your index is invalid, try to set the first reaction and scroll fast it will not crash, then try to check the firebase data and compare the index with number of reactions

@Achisyg2
Copy link
Author

@AmrDeveloper I found the error. Some of the data stored in firestore return as null when I retrieve them. So, the library is working fine I think so. I'll let you know if something new happen.

@AmrDeveloper
Copy link
Owner

@AmrDeveloper I found the error. Some of the data stored in firestore return as null when I retrieve them. So, the library is working fine I think so. I'll let you know if something new happen.

Okey, good luck bro :D

@AmrDeveloper AmrDeveloper added the question Further information is requested label Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants