Daniel

    Daniel

    1 year ago
    has anyone gotten the explicitApi flag to work in android gradle modules?
    Javier

    Javier

    1 year ago
    it works for me
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    1 year ago
    Yes, although if you exclude certain modules in the gradle config, the IDE won’t pick up on that and will still complain about missing visibility modifiers. It’s annoying for things like test source sets.
    Daniel

    Daniel

    1 year ago
    It doesn't work for me unfortunately. Maybe my setup is all wrong. I'd appreciate if anyone can share their gradle setup. Thanks
    k

    KamilH

    1 year ago
    Hey @Daniel have you found a solution? I’m having the same problem -
    explicitApi
    is simply not working. I’m using AS 4.2. I’m trying to add this in my
    android-library
    module. I checked it in my multiplatform project (using IntelliJ) and there it is working as expected
    Daniel

    Daniel

    1 year ago
    still does not work for me
    k

    KamilH

    1 year ago
    Sorry to hear that, but thanks for reply!
    Seem like it’s not working for Android modules yet:https://youtrack.jetbrains.com/issue/KT-37652 I used workaround found here:https://youtrack.jetbrains.com/issue/KT-37652#focus=Comments-27-4501224.0-0 and it’s working well. You can also use this workaround:https://youtrack.jetbrains.com/issue/KT-37652#focus=Comments-27-4436939.0-0 but as it’s mentioned there, it will also enforce explicit API for android tests
    Daniel

    Daniel

    1 year ago
    thanks