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

IndexOutOfBoundsException via HeaderViewListAdapter #251

Closed
AndyScherzinger opened this issue Sep 10, 2016 · 28 comments
Closed

IndexOutOfBoundsException via HeaderViewListAdapter #251

AndyScherzinger opened this issue Sep 10, 2016 · 28 comments

Comments

@AndyScherzinger
Copy link
Member

AndyScherzinger commented Sep 10, 2016

From the Play store developer console. 16 Reports to date.

2 comments:

  • Aug 10, 9:51 PM, v1.2.0, HTC One M9 (htc_himauhl), selecting dropbox folder
  • Jun 14, 3:36 PM, v1.0.0, Xperia Z5 Compact (E5823), One of my folders kill the nextcloud app. This also happend on owncloud.
  • Main and Nightly Version crashing all time on LG G4 #760 at some point browsing through the folders

Environment data

Android version: 6.0

Device model: LG G4 (p1), Xperia Z4 (SOV31), HTC One M9 (htc_himauhl), HTC One (M8) (htc_m8), SHIELD Tablet (shieldtablet)

Stock or customized system: -

Nextcloud app version: 1.0.0 to least 1.4.2 RC4

Logs

java.lang.IndexOutOfBoundsException: Invalid index 5, size is 1
    at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
    at java.util.ArrayList.get(ArrayList.java:308)
    at android.widget.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:164)
    at android.widget.AbsListView.onInitializeAccessibilityNodeInfoForItem(AbsListView.java:2525)
    at android.widget.ListView.onInitializeAccessibilityNodeInfoForItem(ListView.java:3949)
    at android.widget.AbsListView$ListItemAccessibilityDelegate.onInitializeAccessibilityNodeInfo(AbsListView.java:2452)
    at android.view.View.onInitializeAccessibilityNodeInfo(View.java:6079)
    at android.view.View.createAccessibilityNodeInfoInternal(View.java:6040)
    at android.view.View$AccessibilityDelegate.createAccessibilityNodeInfo(View.java:22348)
    at android.view.View.createAccessibilityNodeInfo(View.java:6023)
    at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:145)
    at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:119)
    at android.view.View.onInitializeAccessibilityEventInternal(View.java:5977)
    at android.view.View$AccessibilityDelegate.onInitializeAccessibilityEvent(View.java:22260)
    at android.view.View.onInitializeAccessibilityEvent(View.java:5963)
    at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:5830)
    at android.view.View$AccessibilityDelegate.sendAccessibilityEventUnchecked(View.java:22199)
    at android.view.View.sendAccessibilityEventUnchecked(View.java:5813)
    at android.view.View.sendAccessibilityEventInternal(View.java:5792)
    at android.view.View$AccessibilityDelegate.sendAccessibilityEvent(View.java:22157)
    at android.view.View.sendAccessibilityEvent(View.java:5757)
    at android.widget.AdapterView.performItemClick(AdapterView.java:317)
    at android.widget.AbsListView.performItemClick(AbsListView.java:1188)
    at android.widget.AbsListView$PerformClick.run(AbsListView.java:3100)
    at android.widget.AbsListView$3.run(AbsListView.java:4091)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5525)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
@kartikarora
Copy link

@AndyScherzinger Gonna give this a try!

@AndyScherzinger
Copy link
Member Author

Awesome @kartikarora!

@kartikarora
Copy link

kartikarora commented Oct 2, 2016

@AndyScherzinger I'm unable to reproduce the exception since I don't have a nextcloud server deployed anywhere. Do you have any test credentials that I could use?

@AndyScherzinger
Copy link
Member Author

hi @kartikarora I do not have a testing instance of Nextcloud but @stp-ip might be able to help you out here 😃

@stp-ip
Copy link

stp-ip commented Oct 6, 2016

you can try the instance on demo.nextcloud.com user: test pw: test, but it gets reset from time to time and is not perfect for sensitive data, but if that's not an issue, test away.

@kartikarora
Copy link

Got the app running. Thanks @stp-ip .

@AndyScherzinger Do you have a more detailed stack trace? The one posted above does not indicate which Java file raises this exception. Seems like an incomplete trace to me!

@AndyScherzinger
Copy link
Member Author

@kartikarora unfortunately these are the complete stack traces as reported by the Google Play developer console. I discussed this with @tobiasKaminsky and it is related to the list adapters and is likely due to a race condition where it seems that the rendering/filling of the list is done before the data is present/completely fetched.

@kartikarora
Copy link

Alright I'll start debugging the ListView then. Bug hunt mode on!

@AndyScherzinger
Copy link
Member Author

@kartikarora Awesome! 🎉

@kartikarora
Copy link

kartikarora commented Oct 16, 2016

I tried all visible list views, could not recreate the issue. Or any crash for that matter! There are so many ArrayList instances and adapters! 😕

@AndyScherzinger
Copy link
Member Author

hmm, @tobiasKaminsky any ideas or hints?

@duoduoluo
Copy link

I got the same bug on android 6.0. So, what's the solution?

@AndyScherzinger
Copy link
Member Author

Hi @duoduoluo,

this has been fixed in the latest library release, see PR nextcloud/android-library#24 and is related to the hash function.

@AndyScherzinger
Copy link
Member Author

Needs (yet unreleased lib version 1.0.10)

@AndyScherzinger
Copy link
Member Author

explicitely repopened @tobiasKaminsky since this is the number 1 reported crash in Google Play for the app 1.0.0-1.4.0, so scheduling the fix for 1.4.1

@AndyScherzinger
Copy link
Member Author

still haven't found a way to reproduce this issue, so postponing

@AndyScherzinger AndyScherzinger modified the milestones: Nextcloud App 1.5.0, Nextcloud App 1.4.1 Jan 3, 2017
@IvanAldrich
Copy link

hi, I got this problem recently, any solution or hint? thx.

@kartikarora
Copy link

kartikarora commented Feb 21, 2017

@IvanAldrich Could you explain the steps how you got the issue? It'll help us recreate and debug the issue.

@IvanAldrich
Copy link

@kartikarora when long press a item in the list, we got a dialog to delete the item. we delete the item from the data source and after that, we pick a new list from db to and notify change for the adapter. It happened once so far and i have no idea how to recreate it.. I done know wether it's useful or not that i add a footerview for the listview which's visibility is set Gone when the list is empty.

@AndyScherzinger
Copy link
Member Author

Also reported via #760 now (already closed it).
@mario @tobiasKaminsky any idea how to reproduce this? I tried again browsing through my folders like a monkey but no crashes ever (since version 1.0 I never had one!) while I have to say I am running Android 7+ (which is probably the "fix")

I checked the Play console and it is one of the most reported issues but it is also a Android 6 only reported issue (no other Android version reported this issue!!!)

@IvanAldrich
Copy link

@AndyScherzinger in my case i got this exception in Android-Version:4.2.2, do you mean that after android 7 this issue has been solved?

@AndyScherzinger AndyScherzinger removed this from the Nextcloud App 1.5.0 milestone Apr 17, 2017
@tobiasKaminsky
Copy link
Member

I have no clue :-/

@tobiasKaminsky tobiasKaminsky removed their assignment May 3, 2017
@meicuihui
Copy link

怎么解决?

@PravinsinghWaghela
Copy link

I am facing this issue on Android 6.0 with LG G Stylo device. Is there is any fix for this HeaderViewListAdapter.java:164 of list view which is causing indexOutOfBoundException.

@tobiasKaminsky
Copy link
Member

#2039 will replace the current implementation with the newer recyclerlist, so at least this particular error cannot happen anylonger.

@yongyang007
Copy link

Is this issue related to the accessibility?

@Khang-NT
Copy link

Khang-NT commented Dec 1, 2018

@tobiasKaminsky
Copy link
Member

Never saw this again after merging of #2039, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants