Error inflating class android.support.v4.view.ViewPager
Make sure that you place your libraries in a common folder such as libs in your project.
Right click on the jar, then select Build Path and click on Add to Build Path.
That will add your library to your project. If everything is correct, you can see it in a generated "folder" in the project called "Referenced Libraries"
ClassNotFoundException re android.support.v4.view.ViewPager when inflating
If you are using
Also, change in XML file too
Binary XML file line #18: Error inflating class android.support.v4.widget.view.ViewPager
No static method setOnApplyWindowInsetsListener exception in Android
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.
And also updated
compileSdkVersion to 24,
Now my code runs fine.
Hope it helps.
custom view pager :Error inflating class android.support.v4.app.ViewPager
it should be
RuntimeException: Error inflating class android.suppoort.v4.view.ViewPager
main_activity.xml, you have the class name spelled wrong.
How to fix ViewPager class inflating exception which is reproducable only with the released Google Play Store version
I went ahead and converted ViewPager used by the app to ViewPager2 following this guide and my common sense: https://developer.android.com/training/animation/vp2-migration
Here is the commit: https://github.com/gdgfresno/androidify-yourself/commit/df74fc3f0f2d98c3ae59969db11d3678d57a923a
Apparently this removed all ambiguity and chance for the underlying frameworks to pull out an inappropriately old
ViewPager "rabbit from the magic hat".