expected has no actual declaration for common JVM in project without JVM preset
Asked Answered
G

0

10

I want to create a simple multiplatform app for android and IOS this is my common module config

kotlin{
    sourceSets{
        commonMain{
            dependencies{
                implementation "org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61"
            }
        }
    }

    targets {
        final def iOSTarget = System.getenv('SDK_NAME')?.startsWith('iphoneos') ? presets.iosArm64 : presets.iosX64
        fromPreset(iOSTarget, 'ios'){
            binaries {
                framework('shared')
            }
        }
        fromPreset(presets.android, 'android')
    }
}

and this is my expected interface in my common module

package common
expect interface Response{
    fun submitResponse(res:Int)
}

the problem is IDE show me an error for Response interface that expected has no actual declaration for common JVM but I did not declare JVM as Preset.

these are the actual interfaces for android and IOS

package common

actual interface Response{
    actual fun submitResponse(res:Int)
}
Gaffney answered 20/1, 2020 at 3:8 Comment(3)
What are the actual definitions for ios and android?Talipes
I update the question please take a look.Gaffney
Nothing obvious. Can you post the project somewhere? Github, etc. The next thing I'd look at is if the folder you have your source in is correct. Must be [source root]/androidMain/kotlin/...Talipes

© 2022 - 2024 — McMap. All rights reserved.