I am trying to make a kotlin library for android f...
# android
s
I am trying to make a kotlin library for android for the first time, and I have what seems like a dumb question: Do i always have to add the dependencies from my library module into the gradle file of the app I'm importing the library into? Example. In my module I am using Ktor to fetch a file. I import the module into an a different android application but the application wont build without also adding Ktor its Gradle file. Is there a way to ensure the these dependencies are automatically included with the module?
👍 1
c
t
Are you adding ktor to your library dependencies using “compileOnly” by any chance?
j
Changing
implementation
to
api
in the ktor dependency in your library should fix the problem.
👍 1
s
@tjohnn No i was using implementation @Javier thanks I'll try that
t
@Javier I’ve been reading up on this and that is the answer that keeps coming up. So my question on that is why does
implementation
seem to be the standard? Why use
implemention
ever?
Also @Shawn Karber_ , did that work for you?
j
Because almost all times you don't want to expose other libraries or modules.
👍 1
t
Ok. Well this seems like what I should be doing at work. We build a library that we hand off to integrator and partners to build apps for our clients. A part of our integration that I really hate is all the dependencies they have to include just to get our stuff working. Given - a lot of it is Android/material stuff most of them are using anyway. But still.