I've created a java annotation processor in a project (which I'll call JavaLibrary) that makes use of android.os.Bundle. As such, the project has the following line in its gradle.build dependencies:
compile 'com.google.android:android:4.1.1.4'
In gradle.build, sourceCompatibility
and targetCompatibility
are both set to version 1.6 and this project compiles just fine on its own.
I have also created an Android Library project (which I'll call AndroidLibrary) that depends on JavaLibrary. I'm expecting JavaLibrary to process some annotations used in AndroidLibrary and generate some code.
However, when I try to compile AndroidLibrary, I get the following error:
java.lang.NoClassDefFoundError: android/os/Bundle
The stack trace shows the line where the android.os.Bundle is referenced in JavaLibrary.
Why is this happening and how do I get these two projects to compile together?