I’m trying to setup a multiplatform project that s...
# multiplatform
m
I’m trying to setup a multiplatform project that supports android, ios, js and jvm. My targets config looks like this:
Copy code
targets {
        jvm()
        jvm("android")
        fromPreset(presets.js, "js") {
            compileKotlinJs {
                kotlinOptions.metaInfo = true
                kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js"
                kotlinOptions.sourceMap = true
                kotlinOptions.moduleKind = "commonjs"
                kotlinOptions.main = "call"
            }
        }

        def buildForDevice = project.findProperty("device")?.toBoolean() ?: false
        def iosPreset = (buildForDevice) ? presets.iosArm64 : presets.iosX64
        fromPreset(iosPreset, 'ios') {
            binaries {
                framework {
                    // Disable bitcode embedding for the simulator build.
                    if (!buildForDevice) {
                        embedBitcode("disable")
                    }
                }
            }
        }
    }
Now if I include it in android app module I get an error:
ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :common.
. Removing
jvm()
fixes it so there is some problem with both jvm and android existing at the same time. How can I make it work for both android and jvm?