Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ 12 + ActionBarSherlock settings: Could not find class 'android.support.v4.app.FragmentActivity'

There are numerous Q&A about IntelliJ 12 + ABS(ActionBarSherlock) settings.

similar case to this question but shows different errors.

Overall compilation and runnings are OK but only Activity using Tab Navigation(SherlockActivity implements ActionBar.TabListener) gives following error and crash. Note that I can use general SherlockActivity shows well.

"Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.actionbarsherlock.internal.app.ActionBarWrapper$TabWrapper.onTabReselected" on every overriden methods (onTabUnselected, onTabSelected, onTabReselected).

It seems like android-support-v4 is not sucessfully referenced but hard to find with check/uncheck trial-and-errors.

My IntelliJ project settings are as below.

1. Library is a name of ABS library folder. library settings

2. My project settings. my settings

I set both android-support-v4 to provided. What can I do more?

Some answers said to remove android-support-v4 to my own project but it shows reference errors on import android.support.v4.app.FragmentTransaction because implements ActionBar.TabListener requires it.

like image 246
Youngjae Avatar asked May 06 '13 16:05

Youngjae


1 Answers

This configuration is not correct, the scope of the android-support-v4 library must be set to Compile as it's not present on Android and must be included in your application.

Second copy of android-support-v4 must be removed from the application dependencies, it will be available to your application via a library module that has Export option enabled for android-support-v4.

like image 76
CrazyCoder Avatar answered Oct 30 '22 05:10

CrazyCoder