Java 终结器引发的未捕获异常:绑定器已终结,android密钥库

Java 终结器引发的未捕获异常:绑定器已终结,android密钥库,java,android,authentication,fingerprint,Java,Android,Authentication,Fingerprint,我在我的应用程序中实现了指纹解锁,现在我添加了pin解锁,但应用程序根本没有启动。我尝试更改密钥库实例名称,并使用了相同的密钥库实例名称 有时应用程序会抛出以下错误: E/System: Uncaught exception thrown by finalizer E/System: java.lang.IllegalStateException: Binder has been finalized! at android.os.BinderProxy.transactNativ

我在我的应用程序中实现了指纹解锁,现在我添加了pin解锁,但应用程序根本没有启动。我尝试更改密钥库实例名称,并使用了相同的密钥库实例名称

有时应用程序会抛出以下错误:

E/System: Uncaught exception thrown by finalizer
E/System: java.lang.IllegalStateException: Binder has been finalized!
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(Binder.java:751)
        at android.security.IKeystoreService$Stub$Proxy.abort(IKeystoreService.java:1373)
        at android.security.KeyStore.abort(KeyStore.java:541)
        at android.security.keystore.AndroidKeyStoreCipherSpiBase.finalize(AndroidKeyStoreCipherSpiBase.java:744)
        at android.security.keystore.AndroidKeyStoreUnauthenticatedAESCipherSpi$CBC$PKCS7Padding.finalize(Unknown Source:0)
        at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:253)
        at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:240)
        at java.lang.Daemons$Daemon.run(Daemons.java:103)
当我尝试启动应用程序时,它只是关闭,调试日志或logcat日志中没有崩溃,对此问题有何建议

代码:


我通过检查手机是否具有指纹硬件、手机是否配置了指纹、应用程序是否具有指纹权限以及手机是否已锁定来修复我的问题

    if (!fingerprintManager.isHardwareDetected()) {
        msg.setText("Your device doesn't support fingerprint authentication");
    }
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
        msg.setText("Please enable the fingerprint permission");
    }
    if (!fingerprintManager.hasEnrolledFingerprints()) {
        msg.setText("No fingerprint configured. Please register at least one fingerprint in your device's Settings");
    }

    if (!keyguardManager.isKeyguardSecure()) {
        msg.setText("Please enable lockscreen security in your device's Settings");
    } else {
        try {
            generateKey();
        } catch (FingerprintException e) {
            e.printStackTrace();
        }

        if (initCipher()) {
            cryptoObject = new FingerprintManager.CryptoObject(cipher);
            helper = new FingerprintHandler(this);
            helper.startAuth(fingerprintManager, cryptoObject);
        }
    }

有什么解决方案吗?是的,我找到了一个解决方案,让我搜索一下,已经有一段时间了。当然,请发布。是的,我会发布的
    if (!fingerprintManager.isHardwareDetected()) {
        msg.setText("Your device doesn't support fingerprint authentication");
    }
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
        msg.setText("Please enable the fingerprint permission");
    }
    if (!fingerprintManager.hasEnrolledFingerprints()) {
        msg.setText("No fingerprint configured. Please register at least one fingerprint in your device's Settings");
    }

    if (!keyguardManager.isKeyguardSecure()) {
        msg.setText("Please enable lockscreen security in your device's Settings");
    } else {
        try {
            generateKey();
        } catch (FingerprintException e) {
            e.printStackTrace();
        }

        if (initCipher()) {
            cryptoObject = new FingerprintManager.CryptoObject(cipher);
            helper = new FingerprintHandler(this);
            helper.startAuth(fingerprintManager, cryptoObject);
        }
    }