关于Recyclerview使用时的一个错误java.lang.NoSuchMethodError: No static method getMatrix(Landroid/view/View;)

java.lang.NoSuchMethodError: No static method getMatrix(Landroid/view/View;)Landroid/graphics/Matrix; in class Landroid/support/v4/view/ViewCompat; or its super classes (declaration of 'android.support.v4.view.ViewCompat' appears in /data/data/com.liu.glidedemo/files/instant-run/dex/slice-com.android.support-support-v4-23.4.0_a61901505d5554d4b0d61f04dd34330cf171e4ee-classes.dex)
                                                                       at android.support.v7.widget.RecyclerView$LayoutManager.getTransformedBoundingBox(RecyclerView.java:8100)
                                                                       at android.support.v7.widget.OrientationHelper$2.getTransformedEndWithDecoration(OrientationHelper.java:402)
                                                                       at android.support.v7.widget.LinearLayoutManager.recycleViewsFromStart(LinearLayoutManager.java:1275)
                                                                       at android.support.v7.widget.LinearLayoutManager.recycleByLayoutState(LinearLayoutManager.java:1347)
                                                                       at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1371)
                                                                       at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1193)
                                                                       at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1043)
                                                                       at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4413)
                                                                       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:886)
                                                                       at android.view.Choreographer.doCallbacks(Choreographer.java:698)
                                                                       at android.view.Choreographer.doFrame(Choreographer.java:630)
                                                                       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:872)
                                                                       at android.os.Handler.handleCallback(Handler.java:743)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                       at android.os.Looper.loop(Looper.java:150)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:5643)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:689)

搜索半天都没有看到一样的错误原因,今天看到一个说support.v7:RecyclerView的版本要和support.v7:appcompat一样
看自己的project structure,发现不一致,一个是24.2.0,另一个是23.几,然后改成一样的瞬间解决

你可能感兴趣的:(Android)