Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in Android Version 7 API 24 #11

Open
karthickmurugesa opened this issue Apr 24, 2019 · 4 comments
Open

Crash in Android Version 7 API 24 #11

karthickmurugesa opened this issue Apr 24, 2019 · 4 comments

Comments

@karthickmurugesa
Copy link

karthickmurugesa commented Apr 24, 2019

java.lang.RuntimeException: Unable to start activity ComponentInfo{}: java.lang.RuntimeException: Failed to init Cipher
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6253)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
Caused by: java.lang.RuntimeException: Failed to init Cipher
at com.utils.fingerprint.BiometricManagerV23.initCipher(BiometricManagerV23.java:180)
at com.utils.fingerprint.BiometricManagerV23.displayBiometricPromptV23(BiometricManagerV23.java:55)

@Sammekl
Copy link

Sammekl commented Apr 29, 2019

Could you post the nested exception thrown from: Caused by: java.lang.RuntimeException: Failed to init Cipher? It should be one of the following: CertificateException | UnrecoverableKeyException | IOException | NoSuchAlgorithmException | InvalidKeyException | KeyStoreException.

@DhruvaSambrani
Copy link

DhruvaSambrani commented Jun 14, 2019

This is the same issue but with API 27 on Android emulator.

2019-06-14 13:20:59.906 7217-7217/com.dhruva.iiser E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.dhruva.iiser, PID: 7217
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dhruva.iiser/com.dhruva.iiser.LoginActivity}: java.lang.RuntimeException: Failed to init Cipher
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     Caused by: java.lang.RuntimeException: Failed to init Cipher
        at com.an.biometric.BiometricManagerV23.initCipher(BiometricManagerV23.java:174)
        at com.an.biometric.BiometricManagerV23.displayBiometricPromptV23(BiometricManagerV23.java:53)
        at com.an.biometric.BiometricManager.displayBiometricDialog(BiometricManager.java:70)
        at com.an.biometric.BiometricManager.authenticate(BiometricManager.java:61)
        at com.dhruva.iiser.LoginActivity.onCreate(LoginActivity.java:106)
        at android.app.Activity.performCreate(Activity.java:7009)
        at android.app.Activity.performCreate(Activity.java:7000)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6494) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

    //HERE IS THE ERROR
Caused by: java.security.InvalidKeyException: Only SecretKey is supported
        at com.android.org.conscrypt.OpenSSLCipher.checkAndSetEncodedKey(OpenSSLCipher.java:436)
        at com.android.org.conscrypt.OpenSSLCipher.engineInit(OpenSSLCipher.java:261)
        at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2668)
        at javax.crypto.Cipher.tryCombinations(Cipher.java:2575)
        at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2480)
        at javax.crypto.Cipher.chooseProvider(Cipher.java:567)
        at javax.crypto.Cipher.init(Cipher.java:831)
        at javax.crypto.Cipher.init(Cipher.java:772)
        at com.an.biometric.BiometricManagerV23.initCipher(BiometricManagerV23.java:163)
        at com.an.biometric.BiometricManagerV23.displayBiometricPromptV23(BiometricManagerV23.java:53) 
        at com.an.biometric.BiometricManager.displayBiometricDialog(BiometricManager.java:70) 
        at com.an.biometric.BiometricManager.authenticate(BiometricManager.java:61) 
        at com.dhruva.iiser.LoginActivity.onCreate(LoginActivity.java:106) 
        at android.app.Activity.performCreate(Activity.java:7009) 
        at android.app.Activity.performCreate(Activity.java:7000) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6494) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

@DhruvaSambrani
Copy link

Does this help @Sammekl

@abhiandroid13267
Copy link

it requires runtime permission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants