-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error inflating class com.astuetz.PagerSlidingTabStrip in Android Studio 3 #315
Comments
I have obviously missed what's updated in the whole stack. The messages of type "Can't convert value at index 5 to dimension" are also ruining FontIcon library and possibly a few others. |
I'm having this issue in productive app since compiling with Gradle 4 / Android Studio 3.0, but only on Pixel devices with Android 7.1 and 8.0. |
The good news is (and I wasn't really aware of this) that this functionality can now easily be replaced by TabLayout from the Support Library. This is what I did for MMEX. More details can be seen in the related commits in the issue linked above (1153). |
I'm as well having this issue, after updating from Android Studio 2.3 to 3.0. android.view.InflateException: Binary XML file line #0: Error inflating class com.astuetz.PagerSlidingTabStrip |
As this user on Stackoverflow said regarding this issue. You need to copy the java class from the library into your project and copy the resources in res folder as well. Then open the class and comment I did that and it worked now. |
Because I need a high level of customisation in my projects and this awesome lib seems abandoned, I created a new project that is available here. I'm working on it and I hope this week will be ready for production use. It is written with Android Studio 3. You can check it out here: https://github.com/Crysis21/PagerTabIndicator |
+1 |
Used the solution provided by user " SWoo" (pointed out by 'AlaaZarifa' in the comment section above) on stack overflow https://stackoverflow.com/questions/47006086/error-inflating-class-com-astuetz-pagerslidingtabstrip |
you can leave dependency reference in gradle but do not inflate using inflater (seems to me the problem exists in inflating the slider tabs from XLM file) rather create the tabsliding object using code inside your activity onCreate, the problem starts when you inflate from XLM.This is what I successfully did:
setContentView(R.layout.pagerslidingtabstrip_viewpager);
LinearLayout mainLayout = (LinearLayout) findViewById(R.id.main_layout_view);
mLayoutInflater = getLayoutInflater(); mInflatedViewPagerLayout = mLayoutInflater.inflate(R.layout.separate_viewpager,null); mViewPager = mInflatedViewPagerLayout.findViewById(R.id.viewpager);
mTabStripLayout = new PagerSlidingTabStrip(this);
mPagerAdapter = new SampleFragmentPagerAdapter2(getSupportFragmentManager()); mViewPager.setAdapter(mPagerAdapter); hope it works with you like mentioned as did with me. |
Thanks, it works ! |
1 similar comment
Thanks, it works ! |
Just like in the issue at SO, I'm having the exception in the app during runtime after the app has been compiled with the latest Android Studio 3, Support Library, Gradle, etc.
Stack trace is here:
The text was updated successfully, but these errors were encountered: