Everything of a Maven projected imported to Eclipse appears to be fine. This Maven project has been added to an Android app's build path. The app can be built without any problem. However, whenever a class of the Maven project is instantiated, java.lang.NoClassDefFoundError occurs. For testing, here is a simple class:
package com.my.maven;
public class Foo {
public String sFoo;
public Foo ()
{
sFoo = "Foo";
}
}
Whenever the app reaches the following statement:
Foo foo = new Foo();
The following error occurs:
java.lang.NoClassDefFoundError: com.my.maven.Foo
There are a lot of posts about NoClassDefFoundError, and I have spent a lot of time reading and trying the solutions, but none has worked.
Any tip will be greatly appreciated.
Maven DependenciesnorJRE System Library, inOrder and Exporttab, tick the dependency project, i.e. the one you have added inProjectstab.