Android Unit Testing - Resolution & Verification Problems
- by Bill
I just switched the way my Android project is being built and non of my unit tests work any more...I get errors like
WARN/dalvikvm(575): VFY: unable to resolve static field X in .....
WARN/dalvikvm(575): VFY: unable to find class referenced in signature
These errors only come from my Unit Tests, where classes defined in it can't even see other classes defined in the unit test.
Before each project had its own directory with copies of the 3rd party jar files. I've read around that Dex does weird things with references but haven't been able to figure out how to fix this problem. Is there a better way to do this? I would love to see an example of a large Android workspace where there are multiple projects, jar references, etc...
Is it possible to fix this with an Order/Export tweak ?
The project is structured like this:
Eclipse Workspace (PROJECT_HOME classpath variable)
lib
3rd-party jars
android.jar
Java Project A
Looks in PROJECT_HOME
Java Project B
Looks in PROJECT_HOME
Depends on project A
Android Project
Depends on A & B
Looks in PROJECT_HOME
Android Test Project
Depends on A , B, Android Project
Looks in PROJECT_HOME