Long story short!
I want to add a Android library dependency to a Java module and it says
Warning:Ignoring dependency of module 'backtory-android-sdk' on module 'javasample'. Java modules cannot depend on Android modules
backtory-android-sdk
doesn't have an Android related "compile dependency" (something like retrofit) and if there is a way to add dependency to backtory-android-sdk
's "classes.jar" I assume it will be working. How can I do that?
Explaining the issue...
I'm working on an Android library that mostly do network request (backtory-android-sdk
) and doesn't depend much on Android stuff so It could be initialized and used in a java project. I also have a Java module (a console project named javasample
) for manual testing of the Android library (also used by other members of the team for some automated testing). Here's the confusion:
- If I define
backtory-android-sdk
as Android library, I can't reference it fromjavasample
, complaining that Warning:Ignoring dependency of module 'backtory-android-sdk' on module 'javasample'. Java modules cannot depend on Android modules - If I define it as a Java module, the previous problem resolves but our users at least have to add some manifest stuff manually (our SDK is currently an Android library module). Since almost all of our SDK users are Android developers this is not very desirable.
Since I know one could publish only source code of an Android library, I think its better sticking to Android library module and publish it in two type of AAR and JAR and then the problem reduces to referencing sources of backtory-android-sdk
from javasample
.