https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
b

brabo-hi

03/08/2022, 7:11 PM
Hi all, in a KMM
androidMain
shared project, how can we get access to
Copy code
BuildConfig.APPLICATION_ID
BuildConfig.VERSION_CODE
BuildConfig.VERSION_NAME
r

russhwolf

03/08/2022, 7:43 PM
This is no different than if you had a multimodule Android project without KMP. An Android module will generate a
BuildConfig
with whatever fields are present in the config for that module. If you need access to fields from a top-level app module from a lower-level library module you'll need to pass them in somewhere.
👍 1
x

xxfast

03/09/2022, 7:14 AM
If you want build configs for your
commonMain
, you can try BuildKonfig
☝️ 1
w

wbertan

03/09/2022, 9:40 AM
We use the
BuildKonfig
, I can say we didn't had any issues so far - we even set different values for the same key based on the platform and works fine.
Our setup using
BuildKonfig
you can find here: https://medium.com/clearscore/drivescore-kmm-journey-episode-iii-issues-and-solutions-a83f58234b2#3b6b Where we described it (along with other KMM challenges we had and our solutions for it)
👀 1
2 Views