2016-08-22 174 views
4

我最近從Android支持設計庫中收到此錯誤。是否有一個相同的bug?有沒有人得到類似的錯誤。Android支持崩潰設計庫

AndroidRuntime E FATAL EXCEPTION: main 
        E Process: com.myeglu.android.canary, PID: 11638 
        E java.lang.IndexOutOfBoundsException: Invalid index 5, size is 5 
        E  at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) 
        E  at java.util.ArrayList.get(ArrayList.java:308) 
        E  at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:848) 
        E  at android.view.View.layout(View.java:16651) 
        E  at android.view.ViewGroup.layout(ViewGroup.java:5440) 
        E  at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1197) 
        E  at android.view.View.layout(View.java:16651) 
        E  at android.view.ViewGroup.layout(ViewGroup.java:5440) 
        E  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 
        E  at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 
        E  at android.view.View.layout(View.java:16651) 
        E  at android.view.ViewGroup.layout(ViewGroup.java:5440) 
        E  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 
        E  at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 
        E  at android.view.View.layout(View.java:16651) 
        E  at android.view.ViewGroup.layout(ViewGroup.java:5440) 
        E  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 
        E  at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 
        E  at android.view.View.layout(View.java:16651) 
        E  at android.view.ViewGroup.layout(ViewGroup.java:5440) 
        E  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) 
        E  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) 
        E  at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) 
        E  at android.view.View.layout(View.java:16651) 
        E  at android.view.ViewGroup.layout(ViewGroup.java:5440) 
        E  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 
        E  at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 
        E  at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) 
        E  at android.view.View.layout(View.java:16651) 
        E  at android.view.ViewGroup.layout(ViewGroup.java:5440) 
        E  at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2183) 
        E  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1943) 
        E  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1119) 
        E  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6060) 
        E  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) 
        E  at android.view.Choreographer.doCallbacks(Choreographer.java:670) 
        E  at android.view.Choreographer.doFrame(Choreographer.java:606) 
        E  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 
        E  at android.os.Handler.handleCallback(Handler.java:746) 
        E  at android.os.Handler.dispatchMessage(Handler.java:95) 
        E  at android.os.Looper.loop(Looper.java:148) 
        E  at android.app.ActivityThread.main(ActivityThread.java:5443) 
        E  at java.lang.reflect.Method.invoke(Native Method) 
        E  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) 
        E  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 
+0

logcat中明確表示** java.lang.IndexOutOfBoundsException:無效指數5,大小爲5 **。請檢查您使用的數組列表的大小。 –

+3

YEP。但它來自CoordinatorLayout的內部,這是框架內部代碼。所以,除了讓應用程序崩潰,我無法處理這個問題。 – Gopinath

+0

@Gopinath我看到一樣的。你在使用proguard嗎? –

回答

1

你只需要更新到最新的支持設計庫版本

compile 'com.android.support:design:24.2.1'