Question

I'm working on a project using RoboGuice with Eclipse ADT, m2e and android-maven-plugin.

I'm using RoboListFragment class which depends on android.support.v4.app.ListFragment, for this reason I've added the following dependency to pom.xml

<dependency>
    <groupId>com.google.android</groupId>
    <artifactId>support-v4</artifactId>
    <version>r7</version>
    <scope>provided</scope>
</dependency>

Nevertheless eclipse does not add that library to build path. When I build my project from command line everything is ok, but in eclipse I get this error message:

The type android.support.v4.app.Fragment cannot be resolved. It is indirectly referenced from required .class files

The only workaround I found is adding it to the build path as an external jar, but then .classpath refers to my own home directory.

Was it helpful?

Solution

Try to remove

<scope>provided</scope>

In Maven, this means support-v4 will be in the classpath (see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top