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?
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:
backtory-android-sdk
as Android library, I can't reference it from javasample
, complaining that Warning:Ignoring dependency of module 'backtory-android-sdk' on module 'javasample'. Java modules cannot depend on Android modules
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
.
This is because an Android module contains android components which will not work on a plain Java setup.
Perhaps your dependency needs to be inverted. Otherwise your main Java module will need to be updated to an Android module.
Alternatively if the android module does not do anything Android specific, make it a regular Java module.
The most likely scenario is that you need a 3rd module - an Android application which ties the two parts together
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With