java.lang.StringIndexOutOfBoundsException: length=48; index=-1

GitHub | itchix | 3 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola and rafael . Or join the community to write better ones.
  1. 0
    samebug tip
    If you're using nested fragments, you have to use childFragmentManager instead of fragmentManager.
  2. 0
    samebug tip
    When you use findViewById inside an activity it is going to look for a View inside your main_activity.xml. If it's not there, it throws this exception, try to use the right view to call findviewById.
  3. 0

    Crash when clicking on product in history

    GitHub | 3 months ago | teolemon
    java.lang.StringIndexOutOfBoundsException: length=48; index=-1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    CRASH when clicking on deleted product

    GitHub | 4 months ago | teolemon
    java.lang.StringIndexOutOfBoundsException: length=13; index=-1
  6. 0

    GitHub comment 380#269969617

    GitHub | 4 months ago | teolemon
    java.lang.StringIndexOutOfBoundsException: length=13; index=-1
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.StringIndexOutOfBoundsException

    length=48; index=-1

    at java.lang.String.indexAndLength()
  2. Java RT
    String.substring
    1. java.lang.String.indexAndLength(String.java:294)
    2. java.lang.String.substring(String.java:1067)
    2 frames
  3. openfoodfacts.github.scrachx
    IngredientsProductFragment.onViewCreated
    1. openfoodfacts.github.scrachx.openfood.fragments.IngredientsProductFragment.onViewCreated(IngredientsProductFragment.java:81)
    1 frame
  4. Android Support v4
    ViewPager.onMeasure
    1. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1132)
    2. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1295)
    3. android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801)
    4. android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:1643)
    5. android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:679)
    6. android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:166)
    7. android.support.v4.view.ViewPager.populate(ViewPager.java:1272)
    8. android.support.v4.view.ViewPager.populate(ViewPager.java:1120)
    9. android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1646)
    9 frames
  5. Android Platform
    FrameLayout.onMeasure
    1. android.view.View.measure(View.java:18794)
    2. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    3. android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
    4. android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
    5. android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
    6. android.view.View.measure(View.java:18794)
    7. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    8. android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    8 frames
  6. Android v7
    ContentFrameLayout.onMeasure
    1. android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
    1 frame
  7. Android Platform
    FrameLayout.onMeasure
    1. android.view.View.measure(View.java:18794)
    2. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    3. android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
    4. android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
    5. android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
    6. android.view.View.measure(View.java:18794)
    7. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    8. android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    9. android.view.View.measure(View.java:18794)
    10. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    11. android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
    12. android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
    13. android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
    14. android.view.View.measure(View.java:18794)
    15. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
    16. android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    16 frames
  8. Android
    PhoneWindow$DecorView.onMeasure
    1. com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643)
    1 frame
  9. Android Platform
    ActivityThread.main
    1. android.view.View.measure(View.java:18794)
    2. android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100)
    3. android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216)
    4. android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452)
    5. android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
    6. android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
    7. android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
    8. android.view.Choreographer.doCallbacks(Choreographer.java:670)
    9. android.view.Choreographer.doFrame(Choreographer.java:606)
    10. android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
    11. android.os.Handler.handleCallback(Handler.java:739)
    12. android.os.Handler.dispatchMessage(Handler.java:95)
    13. android.os.Looper.loop(Looper.java:148)
    14. android.app.ActivityThread.main(ActivityThread.java:5461)
    14 frames
  10. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  11. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    2 frames