我的代码是:
import { virgilCrypto } from 'react-native-virgil-crypto';
import { VirgilCardCrypto } from '@virgilsecurity/sdk-crypto';
import { VirgilCardVerifier } from 'virgil-sdk';
function start() {
console.log("START")
const cardCrypto = new VirgilCardCrypto(virgilCrypto);
console.log("MIDDLE")
const cardVerifier = new VirgilCardVerifier(cardCrypto);
console.log("END")
}
start()
我可以看到“ START”和“ MIDDLE”,但此后出现错误:
06-13 09:53:20.835 4619 4978 W ReactNativeJS: Error: Exception in HostFunction: TypeError: expected dynamic type `string', but had type `object'
06-13 09:53:20.835 4619 4978 W ReactNativeJS: [native code]
06-13 09:53:20.835 4619 4978 W ReactNativeJS: fn@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:9824:41
06-13 09:53:20.835 4619 4978 W ReactNativeJS: importPublicKey@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:385391:91
06-13 09:53:20.835 4619 4978 W ReactNativeJS: VirgilCardVerifier@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:389257:57
所以它前进了VirgilCardVerifier -> importPublicKey -> fn
,然后发生了错误。知道有什么问题吗?