Closed xtsxx closed 6 years ago
java.lang.IndexOutOfBoundsException: Index: 2, Size: 1 at java.util.ArrayList.get(ArrayList.java:437) at android.view.ViewGroup.clearDisappearingChildren(ViewGroup.java:6703) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3695) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3693) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3693) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5245) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5216) at android.view.ViewGroup.removeView(ViewGroup.java:5147) at com.qmuiteam.qmui.arch.QMUIFragment$2.onScrollStateChange(QMUIFragment.java:276) at com.qmuiteam.qmui.arch.SwipeBackLayout$ViewDragCallback.onViewDragStateChanged(SwipeBackLayout.java:572) at android.support.v4.widget.ViewDragHelper.setDragState(ViewDragHelper.java:891) at android.support.v4.widget.ViewDragHelper.forceSettleCapturedViewAt(ViewDragHelper.java:605) at android.support.v4.widget.ViewDragHelper.settleCapturedViewAt(ViewDragHelper.java:582) at com.qmuiteam.qmui.arch.SwipeBackLayout$ViewDragCallback.onViewReleased(SwipeBackLayout.java:543) at android.support.v4.widget.ViewDragHelper.dispatchViewReleased(ViewDragHelper.java:780) at android.support.v4.widget.ViewDragHelper.releaseViewForPointerUp(ViewDragHelper.java:1420) at android.support.v4.widget.ViewDragHelper.processTouchEvent(ViewDragHelper.java:1238) at com.qmuiteam.qmui.arch.SwipeBackLayout.onTouchEvent(SwipeBackLayout.java:367) at android.view.View.dispatchTouchEvent(View.java:11776) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2962) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2643) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:448) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1829) at android.app.Activity.dispatchTouchEvent(Activity.java:3307) at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69) at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:410) at android.view.View.dispatchPointerEvent(View.java:12015) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4795) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4609) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4293) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4350) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166) 2018-11-07 17:35:30.969 26505-26505/io.imapp E/AndroidRuntime: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6661) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6635) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6596) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6764) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:186) at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method) at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:177) at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:6735) at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:6787) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) at android.view.Choreographer.doCallbacks(Choreographer.java:723) at android.view.Choreographer.doFrame(Choreographer.java:652) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
java.lang.IndexOutOfBoundsException: Index: 2, Size: 1 at java.util.ArrayList.get(ArrayList.java:437) at android.view.ViewGroup.clearDisappearingChildren(ViewGroup.java:6703) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3695) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3693) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5245) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5216) at android.view.ViewGroup.removeView(ViewGroup.java:5147) at com.qmuiteam.qmui.arch.QMUIFragment.newSwipeBackLayout(QMUIFragment.java:218) at com.qmuiteam.qmui.arch.QMUIFragment.onCreateView(QMUIFragment.java:479) at android.support.v4.app.Fragment.performCreateView(Fragment.java:2439) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852) at android.support.v4.app.BackStackRecord.executePopOps(BackStackRecord.java:860) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2622) at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411) at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366) at android.support.v4.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:884) at android.support.v4.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:827) at com.qmuiteam.qmui.arch.QMUIFragmentActivity.popBackStack(QMUIFragmentActivity.java:159) at com.qmuiteam.qmui.arch.QMUIFragment.popBackStack(QMUIFragment.java:507) at io.imapp.module.mine.ui.AboutUsFragment.lambda$initTopBar$5(AboutUsFragment.java:97) at io.imapp.module.mine.ui.-$$Lambda$AboutUsFragment$KJDfiOabd-Di9rz5noOxE-zkR-g.onClick(Unknown Source:2) at android.view.View.performClick(View.java:6294) at android.view.View$PerformClick.run(View.java:24770) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
撤回0.1.4版本就没有这个问题了
虽然我没有重现这个crash,但猜测应该是修复 #399 造成的问题
试试 0.2.1 版本?
试试 0.2.1 版本?
升级到0.2.1版本后已经解决,感谢
使用0.2.2版本在弹出系统diolog(疑似第三方库的广告)后Activity和fragment都走了onSaveInstanceState,然后就又出现了这个bug
java.lang.IndexOutOfBoundsException: Index: 2, Size: 1 at java.util.ArrayList.get(ArrayList.java:437) at android.view.ViewGroup.clearDisappearingChildren(ViewGroup.java:7029) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3880) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.endViewTransition(ViewGroup.java:7142) at com.qmuiteam.qmui.arch.SwipeBackLayout.clearAnimation(SourceFile:588) at android.support.v4.app.FragmentManagerImpl.endAnimatingAwayFragments(SourceFile:2655) at android.support.v4.app.FragmentManagerImpl.saveAllState(SourceFile:2913) at android.support.v4.app.Fragment.performSaveInstanceState(SourceFile:2517) at android.support.v4.app.FragmentManagerImpl.saveFragmentBasicState(SourceFile:2881) at android.support.v4.app.FragmentManagerImpl.saveAllState(SourceFile:2942) at android.support.v4.app.FragmentController.saveAllState(SourceFile:128) at android.support.v4.app.FragmentActivity.onSaveInstanceState(SourceFile:566) at android.support.v7.app.AppCompatActivity.onSaveInstanceState(SourceFile:509) at com.qmuiteam.qmui.arch.QMUIFragmentActivity.onSaveInstanceState(SourceFile:53) at com.ellisapps.itb.common.base.FragmentsActivity.onSaveInstanceState(SourceFile:70) at android.app.Activity.performSaveInstanceState(Activity.java:1555) at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1392) at android.app.ActivityThread.callCallActivityOnSaveInstanceState(ActivityThread.java:4941) at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4229) at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4288) at android.app.ActivityThread.-wrap25(Unknown) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1724) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Method.java:-2) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
目前已撤回到0.2.1版本,准备再上线,如果后面还有这类问题会再回复
撤回到0.2.1也报错
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.qmuiteam.qmui.arch.QMUIFragmentActivity.isInSuperSaveInstanceState()' on a null object reference at com.qmuiteam.qmui.arch.QMUIFragment$1.needFixFragmentManagerEndAnimatingAwayError(QMUIFragment.java:245) at com.qmuiteam.qmui.arch.SwipeBackLayout.clearAnimation(SwipeBackLayout.java:586) at android.view.ViewGroup.clearDisappearingChildren(ViewGroup.java:6709) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3697) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3695) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3695) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3695) at android.view.ViewGroup.endViewTransition(ViewGroup.java:6818) at android.support.v4.app.FragmentManagerImpl$EndViewTransitionAnimator.run(FragmentManager.java:4073) at android.support.v4.app.OneShotPreDrawListener.onPreDraw(OneShotPreDrawListener.java:64) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:977) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2409) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1452) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6917) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1026) at android.view.Choreographer.doCallbacks(Choreographer.java:838) at android.view.Choreographer.doFrame(Choreographer.java:769) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1012) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6670) at java.lang.reflect.Method.invoke(Method.java:-2) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:821)
可升级到 0.3.0。 这个bug应该算是 fragmentManager 框架的内部bug,之前采取的 hack 方式来修复,但是效果不理想,现在 support library 28 已经修复了这个bug,因此 arch 去掉了之前的hack, 所以使用者需要升级 support library 到 28 或 使用 androidx.
运行环境
小米6
Android 8.1.0
3.2.1
1.1.7
0.2.0
具体问题描述
打开一个新的Fragment然后在退出,会崩溃
问题截图
Layout Inspector 文件(如何获取)
异常日志(堆栈)