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 'android.support.v4.view.ViewCompatLollipop'
that stops my app on setContentView in the MainActivity. How can I solve this?
It's should be the same problem as java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener
Try to only use the 24.2.0 version for all the "com.android.support:xxx:..." in your gradle file.
BTW, now, support v4 is split (https://developer.android.com/topic/libraries/support-library/revisions.html#24-2-0-v4-refactor). Try to use only what you need ;)
I have also face this type of error after update android studio 2.1.2 to 2.1.3, so I change AppCompat version from 23.4.0 to 24.2.0. Hope it will work! Good luck :)
i have also face this type of error after update android studio 2.1.2 to 2.1.3
try MainActivity extends AppCompatActivity to
MainActivity extends Activity
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 openedapp.iml
file (located in app module) and found version of components installed and updated them in build.gradle(app module) file.Like,
to
And also updated
compileSdkVersion
to 24,buildToolsVersion
to24.0.1
,targetSdkVersion
to24
. Now my code runs fine.Hope it helps.
I was facing the same issue.
These are my configuration: compileSdkVersion 25 buildToolsVersion "25.0.2"
Dependency: compile 'com.android.support:support-v4:25.3.1'
I tried many things but finally it worked by updating Android SDK platform tools.
Steps:
Changing the support library versions to the latest solved my problem.
Snapshot of the constants defined in gradle.properties:
Snapshot of the dependencies I added: