Hi. I’m experimenting with Kotlin Multiplatform. I tried to make a fairly simple example to explore sharing a common lib across three platforms: Android, iOS and Web.
Unfortunately, I faced an issue of importing a common lib at JS app.
Gradle warning after syncing in IDE:
Ignoring dependency of module 'lib-common' on module 'app-web-app'. Java modules cannot depend on Android modules
ERROR in ./app.js Module not found: Error: Can't resolve 'lib-common' in '/Volumes/Recoverable/Sources/playam/playam-mpp/app-web/app/build/js' @ ./app.js 3:4-56
At the first glance, it looks like some conflict between ‘com.android.library’ and ‘kotlin-multiplatform’ libraries, but I have seen this kind of configuration before at someone else repo: https://github.com/wojta/hello-kotlin-multiplatform, but with a bit older version of plugins.
This is my repo: https://github.com/rynkowsg/kotlin-mpp-android-ios-web
Tested on Gradle 5.2.1 and 4.10.2, kotlin plugin: 1.3.21, android plugin: 3.3.2.
I’m not sure where is the problem. Any ideas?