Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.view.InflateException error inflating class

Tags:

android

xml

I found some problems when implementing Jake Wharton's ViewPagerIndicator. These are what stated on Logcat:

06-19 15:32:02.661: E/AndroidRuntime(692): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aprian.learn/com.aprian.learn.VPIndicator}: android.view.InflateException: Binary XML file line #7: Error inflating class com.viewpagerindicator.TitlePageIndicator

I have put on the viewpagerindicator library and already put it in build path, but still failed to start the app.

like image 469
Aprian Avatar asked Feb 20 '23 03:02

Aprian


1 Answers

You need to add the ViewPagerIndicator as a Libarary project as per Referencing Library Projects. Using it as a .jar-file doesn't work.

Basic steps are: Add the ViewPagerIndicator as a New Project from existing source and

To add a reference to a library project, follow these steps:

  1. In the Package Explorer, right-click the dependent project and select Properties.
  2. In the Properties window, select the "Android" properties group at left and locate the Library properties at right.
  3. Click Add to open the Project Selection dialog.
  4. From the list of available library projects, select a project and click OK.
  5. When the dialog closes, click Apply in the Properties window.
  6. Click OK to close the Properties window.

If this doesn't work, try Project -> Clean.

Edit: Also see this answer from Jake Wharton : Answer

like image 191
Qw4z1 Avatar answered Mar 06 '23 08:03

Qw4z1