Hello everyone! I'm running into a problem that I ...
# multiplatform
r
Hello everyone! I'm running into a problem that I don't know how to solve. I've got the following extension function declared inside my
commonMain
module:
Copy code
fun String.asCharArray(): CharArray {
    return (this as CharSequence).toList().toCharArray()
}
This is used inside the following function:
Copy code
fun MnemonicWords.toSeed(password: String = ""): Seed {
    val pass = words.joinToString(" ")
    val salt = "mnemonic$password"

    return Seed(PBKDF2.derive(pass.asCharArray(), salt.toByteArray()))
}
Then I have a test inside my
commonTest
module as follows:
Copy code
testData.forEach {

    val expectedSeed = Seed(it.seed.hexToByteArray())
    val actualSeed = MnemonicWords(it.phrase).toSeed("TREZOR")

    assertEquals(expectedSeed.seed, actualSeed.seed)
}
When I try running it, I get the following error:
Copy code
com.example.StringKt.asCharArray(Ljava/lang/String;)[C
java.lang.NoSuchMethodError: com.example.StringKt.asCharArray(Ljava/lang/String;)[C
How can I fix this?