j

    jermainedilao

    4 years ago
    I’m using 3.0.1 in AS 3.0.1
    gildor

    gildor

    4 years ago
    Maybe you could try to reproduce this on sample project. If it’s a bug of Android Plugin would be nice to report an issue and attach this sample project
    j

    jermainedilao

    4 years ago
    @gildor got it, already tried on a sample project. it builds successfully if only one local module is added (either java library or android library). App goes into limbo once i add another new local module.
    gildor

    gildor

    4 years ago
    Probably I know what is the reason of this behavior
    Probably problem with different class paths
    replace
    implementation
    with
    api
    in your domain
    implementation
    dependency hidden from consumer of module with this dependency, it’s special feature of Gradle that allows to use some dependency only internally for some module, without leak abstractions. But if some module expose some type of dependency, you should use api instead.
    I’m not 100% sure, but you can try to check this
    j

    jermainedilao

    4 years ago
    @gildor you mean, instead of using
    implementation project(':domain')
    in my data build.gradle i will use this
    api project(':domain')
    ?
    gildor

    gildor

    4 years ago
    yes, in your subprojects. In your
    app
    module you still use
    implementation
    j

    jermainedilao

    4 years ago
    I see. let me try
    gildor

    gildor

    4 years ago
    this is simple rule:- if module uses dependency only internally and you don’t expose types of dependency. use
    implementation
    , it allows you in the future remove or replace this dependency and don’t worry that some consumer used it.- If module uses dependency and expose some types/classes of this dependency to own consumers, use
    api
    . In this case dependency public API now part of your module public API
    j

    jermainedilao

    4 years ago
    Oh my, you’re going to hate me for this. As I was doing what you said above ^. I noticed that in my domain build.gradle.
    apply plugin: 'kotlin'
    line is missing. Build, and voila. Build succeeded. Thanks so much for the input! I learned something new today.
    gildor

    gildor

    4 years ago
    😱
    Ohhh %) Nice. Still not clear for me why you get such error message.
    j

    jermainedilao

    4 years ago
    Ikr. Error bit misleading. build failed during
    compileDebugKotlin
    was my only clue
    j

    James Coggan

    4 years ago
    done that in the past, AS doesnt add kotlin to new modules automatically 😕