giulicom giulicom - 2 years ago 690
Android Question

No static method setOnApplyWindowInsetsListener exception in Android

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 setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompatLollipop; or its super classes (declaration of ''

that stops my app on setContentView in the MainActivity.
How can I solve this?

Answer Source

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.


compile ''


compile ''

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

Hope it helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download