The hierarchy of the type MainActivity is inconsistent

user2329454 picture user2329454 · Aug 27, 2013 · Viewed 10.7k times · Source

I created a new Android project via eclipse, with a MainActivity. I added ActionBarSherlock to the project (Properties > Android and clicked Add). Then, when I replace "extends Activity" with "extends SherlockFragmentActivity" I get a compile error "The hierarchy of the type MainActivity is inconsistent".

I also tried to create a project without an Activity, then created a class "MainActivity" that inherits from SherlockFragmentActivity, and there are no compile time errors, but with a run-time error "ClassNotfoundException: com.NadavLitvak.nadavfragmentdemo.MainActivity"

Answer

Harlo Holmes picture Harlo Holmes · Sep 6, 2013

Your project should also reference the android-support-v4.jar (which is included in ABS's libs folder.) So, Properties->Java Build Path->Add JARs... and select that jar from ActionBarSherlock->libs