Is it possible to have 2 applications modules (with apply plugin: 'com.android.application'
at the head of their gradle file) and one having a dependency over another?
So module A would have a dependency to module B and both would be applications.
dependencies {
...
compile project(':moduleB')
}
I easily managed to add this dependency and no errors/warnings comes out but I still do not have access to source files inside moduleB. Android Stduio still suggest me to "add dependency to moduleB" and when I do it just re-syncing gradle and nothing happen.
I tried to include a dependency over a library module and this is working fine. Can't we add dependency between two (or more) applications modules?
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file.
In Android Studio, Right-clicking on the folder to add as library. Editing the dependencies in the build. gradle file, adding: compile fileTree(dir: 'libs', include: '*. jar')}
Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.
Import a module To import an existing module into your project, proceed as follows: Click File > New > Import Module. In the Source directory box, type or select the directory of the module(s) that you want to import: If you are importing one module, indicate its root directory.
Is it possible to have 2 applications modules (with apply plugin: 'com.android.application' at the head of their gradle file) and one having a dependency over another?
No, sorry.
Can't we add dependency between two (or more) applications modules?
Correct — that is not supported.
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