How do I use a kotlin-platform-android project (th...
# multiplatform
g
How do I use a kotlin-platform-android project (that is an android library itself) in an Android App (without deploying to a maven repo) ? It works out of the box with jars from kotlin-platform-jvm… help!
t
Doesn't it work just as
project
dependency?
r
What's the problem you're having? It's hard to say much without seeing your gradle files and hearing more details about your issue.
g
You are totally right. I took https://github.com/JetBains/kotlin-mpp-example and replace the kotlin-platform-jvm one with kotlin-platform-android. It compiles in itself and created an aar in the output folder but when opened with Android Studio to edit the app I get a message saying that Greeting does not exist in AndroidApp. I hope this clarifies what I meant
Oh seems like I simply opened the whole project on Android Studio instead of only the AndroidApp project which couldnt find :greeting in AndroidApp
t
@galex try to rename kotlin folder to java
I'll try to open another PR with fixes/workarounds soon
b
@galex If you are still interested, I have made a very simple project with Android and JS : https://github.com/bmonjoie/magicsquare
It works both in IntelliJ and Android Studio and is very simple 😉
g
Thanks @bmo I’m building a presentation and project on MPP with JS + Android + iOS, almost got the architecture of the project right 😛
I wonder how I am supposed to develop the iOS part, I understood in CLion, that’ll be the test of tonight
b
AFAIK, sharing code with ios is not possible at the moment, only jvm and Javascript
g
What ? I managed to have a lib with /common, /js, /android (android Library) and /ios for now… In the common there’s only one simple except class
Maybe implementing the iOS part will be impossible?
t
iOS is definitely possible, even common tests works on simulator
r
iOS code-sharing is absolutely possible. It's been possible to configure kotlin native for multiplatform since 0.6
😱 1
g
Yay!