NoSuchMethodError: No static method setOnApplyWindowInsetsListener

NoSuchMethodError: No static method setOnApplyWindowInsetsListener

我正在编译我的项目,突然遇到致命异常:NoSuchMethodError错误

附加信息

build.gradle

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.incorp.eronlabs.dictapp"
        minSdkVersion 17
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.android.support:support-v4:23.4.0'
    compile 'com.android.support:cardview-v7:23.4.0'
    compile 'com.android.support:recyclerview-v7:23.4.0'
    compile 'com.google.android.gms:play-services-ads:10.0.1'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.simplecityapps:recyclerview-fastscroll:1.0.11'

    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

这里是 LogCat

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.incorp.eronlabs.dictapp, PID: 12816
java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompatLollipop; or its super classes (declaration of 'android.support.v4.view.ViewCompatLollipop' appears in /data/data/com.incorp.eronlabs.dictapp/files/instant-run/dex/slice-internal_impl-24.2.0_9cb479e147afde859c42f0015b56fc92a26fd3f7-classes.dex)
at android.support.v4.view.ViewCompat$LollipopViewCompatImpl.setOnApplyWindowInsetsListener(ViewCompat.java:1619)
at android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(ViewCompat.java:2924)
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:425)
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:312)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:277)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.incorp.eronlabs.dictapp.Splash.onCreate(Splash.java:22)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

RecyclerView-FastScroll 使用支持库的“24.*.*”版本,因此这可能会导致 类 它的预期与实际存在的不匹配。

将您的支持依赖项更新为 24(或更新为 25)可能会解决您的问题。参见