https://kotlinlang.org logo
#android-studio
Title
# android-studio
d

Daniel

02/05/2021, 8:55 PM
has anyone gotten the explicitApi flag to work in android gradle modules?
1
j

Javier

02/05/2021, 9:11 PM
it works for me
z

Zach Klippenstein (he/him) [MOD]

02/05/2021, 9:18 PM
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.
d

Daniel

03/02/2021, 1:57 PM
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

05/07/2021, 8:14 AM
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
d

Daniel

05/07/2021, 8:16 AM
still does not work for me
k

KamilH

05/07/2021, 8:16 AM
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
d

Daniel

05/17/2021, 5:55 AM
thanks
2 Views