2017-12-31 209 views
0

이 코드는 java.lang.IndexOutOfBoundsException입니다. 코드에서 추적하고 싶지만, 안드로이드 스튜디오는 문제가 어디서 시작되는지를 알기에 충분한 백 스택 (디버그 및 로그 탭)을 제공하지 않습니다. . 표시된 디버그 정보의 크기를 늘리고 싶지만 어떻게해야할지 모르겠다.Android Studio의 디버그 (logcat?) 크기를 늘리십시오.

나는 이미 여기에 표시된 두 가지 방법을 시도했다 : Android Studio logcat history/buffer size하지만 작동하지 않는 것처럼 보였다. 나는 항상 동일한 디버그 정보를 얻고있다.

--------- beginning of crash 
E/AndroidRuntime: FATAL EXCEPTION: main 
        Process: com.zboot.alarm1, PID: 3011 
        java.lang.IndexOutOfBoundsException: Invalid index 7, size is 7 
         at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) 
         at java.util.ArrayList.get(ArrayList.java:308) 
         at com.bignerdranch.expandablerecyclerview.Adapter.ExpandableRecyclerAdapter.getItemViewType(ExpandableRecyclerAdapter.java:233) 
         at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5631) 
         at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5563) 
         at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5559) 
         at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2229) 
         at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1556) 
         at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1516) 
         at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:608) 
         at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3693) 
         at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3109) 
         at android.view.View.measure(View.java:18788) 
         at android.support.constraint.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:934) 
         at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:973) 
         at android.view.View.measure(View.java:18788) 
         at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
         at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:714) 
         at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:786) 
         at android.view.View.measure(View.java:18788) 
         at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
         at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) 
         at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139) 
         at android.view.View.measure(View.java:18788) 
         at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
         at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) 
         at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) 
         at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) 
         at android.view.View.measure(View.java:18788) 
         at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
         at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) 
         at android.view.View.measure(View.java:18788) 
         at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
         at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) 
         at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) 
         at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) 
         at android.view.View.measure(View.java:18788) 
         at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
         at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) 
         at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643) 
         at android.view.View.measure(View.java:18788) 
         at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100) 
         at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216) 
         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452) 
         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) 
         at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) 
         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) 
         at android.view.Choreographer.doCallbacks(Choreographer.java:670) 
         at android.view.Choreographer.doFrame(Choreographer.java:606) 
         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 
         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:5417) 
        at j 

답변

0

정확한 해결책이 아니라 예외 추적을 얻는 가장 좋은 방법 중 하나입니다.

당신은 사용 Crashlytics 이상 모든 예외를 기록해야합니다 :

Crashlytics.logException(e); 

모든 기록 된 예외는 비 치명적 오류로보고됩니다.