I managed to set up a minimal kotlin multi platform project. It works fine except for one use case. I am not sure whether this is a limitation of kotlin multi platform projects, or whether I am doing something wrong.
What works fine is:
- Kotlin code within my JVM module can access and execute Kotlin code within my common module.
- Java code within my JVM module can access and execute Kotlin code within my JVM module.
What does not work is:
- Java code within my JVM module cannot directly access Kotlin code within my common module.
In the last case I will get error messages like “java.lang.String is not compatible with java.lang.String”.
Is this a known limitation or is it supposed to work?
Update: I now know that this is an IntelliJ issue. Compiling with Gradle will work without problems. It is just the IDE that shows compiling errors.