This question stems from the fact that I am not a Gradle expert and I come from Eclipse + Maven background.
In Maven, I was able to refer to my apk project from another one (a Robolectric sub-project for instance), as the android-maven-plugin
was pushing both .apk
and (un-dexed) .jar
in my local repository.
How can I achieve the same in Android Studio + Gradle?
- I tried to add
apply plugin: 'java'
to my app project but the java plugin is not compatible with the android plugin. I tried to build a sub-module of my app with the java plugin only with
build.gradle
, but R.java is not generated this way:sourceSets { main { java.srcDirs = parent.android.sourceSets.main.java.srcDirs } }
Is there any other way to do this?
EDIT4: posted solution.