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

Fatal Exception: java.lang.IndexOutOfBoundsException Empty list doesn't contain element at index 0. #102

Open
hoangkt57 opened this issue Feb 25, 2022 · 2 comments

Comments

@hoangkt57
Copy link

Hi,
I have an issue that occurs many times in the app
I guess it happens when user clicks an item in SmoothBottomBar but I don't know why FC here
If user can click an item then bottomBarItems can't be empty
node.contentDescription = bottomBarItems[virtualViewId].contentDescription
Can you help me with this issue?
Thanks~!

My code:
<me.ibrahimsn.lib.SmoothBottomBar
android:id="@+id/bottom_navigation_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/main_action_bar_height"
app:backgroundColor="@color/bottom_nav_bg"
app:cornerRadius="12dp"
app:iconSize="24dp"
app:iconTint="@color/bottom_nav_icon"
app:iconTintActive="@color/bottom_nav_icon_active"
app:indicatorColor="@color/bottom_nav_indicator"
app:indicatorRadius="@dimen/main_action_bar_height"
app:itemFontFamily="@font/app_font"
app:itemPadding="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:textColor="@color/bottom_nav_text"
app:textSize="14sp" />

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    binding.bottomNavigationBar.itemMenuRes = if (!BuildConfig.SUPPORT_CATEGORY) {
        R.menu.bottom_navigation_no_category
    } else {
        R.menu.bottom_navigation
    }

This is log in firebase.
Fatal Exception: java.lang.IndexOutOfBoundsException
Empty list doesn't contain element at index 0.
kotlin.collections.EmptyList.get (Collections.kt:36)
kotlin.collections.EmptyList.get (Collections.kt:24)
me.ibrahimsn.lib.AccessibleExploreByTouchHelper.onPopulateNodeForVirtualView (AccessibleExploreByTouchHelper.kt:35)
androidx.customview.widget.ExploreByTouchHelper.createNodeForChild (ExploreByTouchHelper.java:805)
androidx.customview.widget.ExploreByTouchHelper.obtainAccessibilityNodeInfo (ExploreByTouchHelper.java:725)
androidx.customview.widget.ExploreByTouchHelper.createEventForChild (ExploreByTouchHelper.java:680)
androidx.customview.widget.ExploreByTouchHelper.createEvent (ExploreByTouchHelper.java:643)
androidx.customview.widget.ExploreByTouchHelper.invalidateVirtualView (ExploreByTouchHelper.java:572)
androidx.customview.widget.ExploreByTouchHelper.invalidateVirtualView (ExploreByTouchHelper.java:544)
me.ibrahimsn.lib.SmoothBottomBar.onClickAction (SmoothBottomBar.kt:537)
me.ibrahimsn.lib.SmoothBottomBar.onTouchEvent (SmoothBottomBar.kt:523)
android.view.View.dispatchTouchEvent (View.java:13503)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3073)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2766)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3073)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2766)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3073)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2766)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3073)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2766)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3073)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2766)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3073)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2766)
com.android.internal.policy.DecorView.superDispatchTouchEvent (DecorView.java:613)
com.android.internal.policy.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1933)
android.app.Activity.dispatchTouchEvent (Activity.java:4147)
androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent (WindowCallbackWrapper.java:69)
com.android.internal.policy.DecorView.dispatchTouchEvent (DecorView.java:559)
android.view.View.dispatchPointerEvent (View.java:13766)
android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent (ViewRootImpl.java:5824)
android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:5619)
android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5063)
android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5116)
android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5082)
android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:5239)
android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5090)
android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:5296)
android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5063)
android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5116)
android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5082)
android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5090)
android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5063)
android.view.ViewRootImpl.deliverInputEvent (ViewRootImpl.java:7954)
android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java:7905)
android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java:7859)
android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent (ViewRootImpl.java:8144)
android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:233)
android.os.MessageQueue.nativePollOnce (MessageQueue.java)
android.os.MessageQueue.next (MessageQueue.java:363)
android.os.Looper.loop (Looper.java:173)
android.app.ActivityThread.main (ActivityThread.java:8178)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:513)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1101)

@Hieuntdz
Copy link

Hieuntdz commented May 2, 2024

same problem

@PratikFagadiya
Copy link

@hoangkt57 @Hieuntdz Are you able to solve this issue ? Im facing same issue

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

No branches or pull requests

3 participants