Add application module dependency into another app

2020-06-09 04:12发布

问题:

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?