Cannot compile JUnit 4 code under Android in IDEA

I am attempting to portions of the functionality of a Java Swing application to Android.  I'd like to re-use much of the codebase and just slap an Android UI on top of the base.  To this end, I am trying to compile some existing Util package JUnit 4 code referenced in the Android IDEA Module so that I can see the unit tests running on the device itself.  

I have the following setup:

- for now, I have simply copied the test/ src directory from the existing module into the Android module.
- I have added the JUnit 4 jar dependency to the Android module
- I have added the Util module as a dependency to the Android module

When I attempt to compile, I get a ton of warnings, and 1 error (which I think is due to the warnings).  They say:

Ignoring InnerClass attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute (This class was probably produced by a broken compiler).

another warning says:

trouble processing:
class name (com/mycompany/android/MyActivity) does not match path (production/Android/com/mycompany/android/MyActivity.class)

These warnings are repeated multiple times for different classes, and they are proceeded by an "error" in the IDEA compile log, but IDEA doesn't tell me what the error is.

Any ideas?  Maybe I misunderstand Android, but I thought I'd have access to the same base/lang java classes that one gets with a standard VM?  Maybe this isn't the case, and that's why I'm getting these problems when compiling standard java code?

Please sign in to leave a comment.