No static method setOnApplyWindowInsetsListener exception in Android

后端 未结 7 1615
借酒劲吻你
借酒劲吻你 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:47

    I had same issue. I tried to run my code on another system with latest downloaded version of Android SDK (API 24). compileSdkVersion of my code was 23. So, what I did is I opened app.iml file (located in app module) and found version of components installed and updated them in build.gradle(app module) file.

    Like,

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

    to

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

    And also updated compileSdkVersion to 24, buildToolsVersion to 24.0.1, targetSdkVersion to 24. Now my code runs fine.

    Hope it helps.

提交回复
热议问题