I am using ActionBarSherlock as a library project in a project which is a library itself. It was all working fine until I moved the project to a new computer and updated the SDK tools.
I have this error I don't understand. When I create a class extending SherlockFragment like this:
import com.actionbarsherlock.app.SherlockFragment;
public class SomeFragment extends SherlockFragment {
...
}
I have the following compilation error:
The type android.support.v4.app.Fragment cannot be resolved. It is indirectly referenced from required .class files
I have checked the following:
Anything else?
I had the same problem as you since I had updated the SDK. I have solved my problem by doing this (on eclipse) :
Properties
=> Java Build Path
=> Order and Export
tab => check android support v4
or Android Private Libraries
and select Okcheck Android Private Libraries
Sebastien's answer actually led me to the solution. However, it is important to mention that the support library has to be added manually to the build path in order to be able to check it for exporting. For future reference, here are the steps that solved the problem for me:
However, it is a mystery for me why this has to be so complicated - as Josh mentioned, Eclipse in combination with Android and large projects with a couple of dependencies is hard to use and I hope this will be improved in near future.
In my case I'm using 2 Android libraries which require the android support library. The problem was that both libraries had different versions of the Android support library.
To resolve the issue: Right click on the library project => Android Tools => Add Support Library.
Repeat this action for each library.
I had same problem. There were 2 different libraries. Delete support library from your main project
Here is simplest solution:
Right click on your project folder -> Build path -> Configure build path -> Add External Jars(From libraries tab) -> select "android-support-v4.jar" file.
(It'll be located in Android SDK folder here is generic path "android-sdk\extras\android\support\v4").
After this clean you project and happy coding...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With