No static method setOnApplyWindowInsetsListener exception in Android

后端 未结 7 1579
借酒劲吻你
借酒劲吻你 2020-12-07 01:01

I downloaded yesterday Android Studio 2.1.3 (before I worked with 1.5) and now I have this exception:

java.lang.NoSuchMethodError: No static method setOnAppl         


        
7条回答
  •  庸人自扰
    2020-12-07 01:39

    Changing the support library versions to the latest solved my problem.

    Snapshot of the constants defined in gradle.properties:

    BUILD_TOOLS_VERSION=23.0.2
    COMPILE_SDK_VERSION=23
    TARGET_SDK_VERSION=23
    DESIGN_SUPPORT_VERSION=24.2.0 //changed from 23.2.0
    APPCOMPAT_VERSION=24.2.0 //changed from 23.2.0
    ANDROID_SUPPORT_VERSION=24.2.0 //changed from 23.2.0
    

    Snapshot of the dependencies I added:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile ("com.android.support:appcompat-v7:${project.APPCOMPAT_VERSION}"){
            exclude module: 'support-v4'
        }
        compile "com.google.android.gms:play-services-analytics:${project.PLAY_SERVICES_VERSION}"
        compile "com.google.android.gms:play-services-gcm:${project.PLAY_SERVICES_VERSION}"
        compile "com.android.support:design:${project.DESIGN_SUPPORT_VERSION}"
        compile "com.android.support:recyclerview-v7:${project.ANDROID_SUPPORT_VERSION}"
        compile "com.android.support:cardview-v7:${project.ANDROID_SUPPORT_VERSION}"
        compile "com.google.android.gms:play-services-location:${project.PLAY_SERVICES_VERSION}"
        compile "com.google.android.gms:play-services-maps:${project.PLAY_SERVICES_VERSION}"
        /* google maps*/
        compile 'com.squareup.picasso:picasso:2.4.0'
        compile 'com.google.code.gson:gson:2.5'
        compile 'com.jakewharton:disklrucache:2.0.2'
        compile project(':volley')
    }
    

提交回复
热议问题