komputing / KEthereum

Kotlin library for Ethereum
MIT License
344 stars 72 forks source link

There is not implementation found for mac.HmacImpl #138

Closed geofferyj closed 1 year ago

geofferyj commented 1 year ago

I have the above error when I try to use mnemonicWords.toKey() function

I have already added bouncycastle as it is in the walleth code

bellow is the full error

Exception in thread "main" java.lang.RuntimeException: There is not implementation found for mac.HmacImpl - you need to either depend on crypto_impl_spongycastle or crypto_impl_bouncycastle
    at org.kethereum.crypto.CryptoAPIKt.loadClass(CryptoAPI.kt:15)
    at org.kethereum.crypto.CryptoAPI$hmac$2.invoke(CryptoAPI.kt:19)
    at org.kethereum.crypto.CryptoAPI$hmac$2.invoke(CryptoAPI.kt:19)
    at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    at org.kethereum.crypto.CryptoAPI.getHmac(CryptoAPI.kt:19)
    at org.kethereum.bip32.ConverterKt.toExtendedKey-oOkmR4Q(Converter.kt:23)
    at org.kethereum.bip32.ConverterKt.toExtendedKey-oOkmR4Q$default(Converter.kt:21)
    at org.kethereum.bip32.BIP32.toKey-oOkmR4Q(BIP32.kt:26)
    at org.kethereum.bip32.BIP32.toKey-oOkmR4Q$default(BIP32.kt:25)
    at org.kethereum.bip39.MnemonicKt.toKey-aHn7skU(Mnemonic.kt:78)
    at org.kethereum.bip39.MnemonicKt.toKey-aHn7skU$default(Mnemonic.kt:77)
    at com.example.rawkotlinproject.MainKt.main(Main.kt:30)
    at com.example.rawkotlinproject.MainKt.main(Main.kt)
ligi commented 1 year ago

You need to share a full project (ideally reduced to the error) so there is even a chance to say what is going on there

geofferyj commented 1 year ago

it's working now

initially i wanted to find my way around the library as there is no documentation at this time so i created a temp intellij project for the test, the error came from there, when i re-ran the project in android studio, it work perfectly.

when I get get my footing on the Library, will it be ok if I documented it? I'll close this now, thank you

ligi commented 1 year ago

sure thing - happy about every documentation attempt!