Davide Bellettini
Davide Bellettini

Reputation: 63

Maven Eclipse Plugin won't add Android support-v4 to build path

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.

Upvotes: 3

Views: 818

Answers (1)

pralonga
pralonga

Reputation: 106

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)

Upvotes: 4

Related Questions