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

Pramod Shri

11/14/2023, 4:10 PM
So, we are thinking of using KMM to make our existing Android App work on iOS. There are some Android libraries which are written in Java we are using. How could we make it work on iOS when we move to KMM? Should we replace them with some other libraries or is it going to just work? I know this could sound dumb but I’m just starting off with KMM.
k

khalid64927

11/14/2023, 4:12 PM
As long as you keep them in commanMain it will work, Ah It won’t work https://stackoverflow.com/questions/68194832/kmm-with-java-sources-in-common-shared-module
🚫 2
z

zsmb

11/14/2023, 4:17 PM
If the libraries are JVM-specific, you'll need to find replacements for them that support multiplatform (if they are available), or write a common API that delegates to those libraries on the JVM and to other implementations on other platforms
☝️ 3
l

Landry Norris

11/14/2023, 6:49 PM
You should also check if there is a KMM-compatible equivalent to the Android library. For example, retrofit or OkHTTP could be replaced with ktor or ktorfit. You could also open an issue on the Android dependency requesting multiplatform support.
👍 1