Tag: android fingerprint api

Android Keystore?.getKey在某些设备上返回null

我在我的应用程序中实施指纹认证。 我面临的问题是在某些设备上无法正常工作,而我的应用程序崩溃。 不过,它也适用于某些设备。 问题是在这一行 val key = keyStore?.getKey(Constants.FINGERPRINT_KEY_NAME, null) as SecretKey LogCat说: 11-02 14:27:42.825 E: FATAL EXCEPTION: main Process: kyivenergo.ua.kyivenegro, PID: 2298 java.lang.RuntimeException: Unable to start activity ComponentInfo{kyivenergo.ua.kyivenegro/ua.dtec.appOk.ui.screens.splash.SplashScreenActivity}: kotlin.TypeCastException: null cannot be cast to non-null type javax.crypto.SecretKey at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at […]