NoSuchMethodError,函数名称已更改

问题描述

java.lang.NoSuchMethodError:'java.math.BigInteger org.kethereum.model.ECKeyPair.getPrivateKey-V6oYYD4()'

我在项目中使用了KEthereum库,当调用方法 .getPrivateKey()时,在原始函数中添加了这个奇怪的随机字符串 -V6oYYD4 。我以前从未遇到过此类问题。

原始函数名称: .getPrivateKey()

修改后的函数名称: .getPrivateKey-V6oYYD4()

函数正在从单元测试中调用。我正在使用Kotlin。

执行的代码行是

    c:\users\admin\appdata\local\programs\python\python38-32\include\pyconfig.h(206): fatal error C
1083: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о祭ЁҐ: basetsd.h: No such file or directory,error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed
with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\admin\appdata\local\programs\python\python
38-32\python.exe' -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'C:\\Users\\admin\\App
Data\\Local\\Temp\\pip-install-069vr9ot\\immutables\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\
\AppData\\Local\\Temp\\pip-install-069vr9ot\\immutables\\setup.py'"'"';f=getattr(tokenize,'"'"'ope
n'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(
code,__file__,'"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-_f
7_ducl\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\user
s\admin\appdata\local\programs\python\python38-32\Include\immutables' Check the logs for full command output.

编辑:已解决!问题出在其他地方。我看过test file of the library,我意识到我必须先序列化ExtendedKey。所以我做到了,我的代码如下:

val seed: org.kethereum.bip32.model.Seed = MnemonicWords(VALID_MNEMONIC_15).toSeed()
val actualPrivateKey: String = seed.toKey("m/").keyPair.privateKey.key.toString()

现在一切正常。

最后的多余字符串可能来自编译后的JVM代码。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...