Skip to content

Caused by java.lang.NullPointerException: null cannot be cast to non-null type java.security.KeyStore.SecretKeyEntry #881

@pedrotrabulo-hw

Description

@pedrotrabulo-hw

Hi,

I have recently noticed that after migrating from SDK version 3.5.4 to 3.5.6 the following crash started to happen whenever we attempt to set the email upon application startup using the method IterableApi.setEmail.

The crash is affecting users with

  • Android 13
  • Android 14

Here is the stack trace:

Caused by T0.c: java.lang.NullPointerException: null cannot be cast to non-null type java.security.KeyStore.SecretKeyEntry
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187)
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:138)
       at androidx.startup.AppInitializer.initializeComponent(AppInitializer.java:117)
       ...
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6998)
       at android.app.ActivityThread.-$$Nest$mhandleBindApplication()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:205)
       at android.os.Looper.loop(Looper.java:294)
       at android.app.ActivityThread.main(ActivityThread.java:8177)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

Caused by java.lang.NullPointerException: null cannot be cast to non-null type java.security.KeyStore.SecretKeyEntry
       at com.iterable.iterableapi.IterableDataEncryptor.getKey(IterableDataEncryptor.kt:122)
       at com.iterable.iterableapi.IterableDataEncryptor.encryptModern(IterableDataEncryptor.kt:193)
       at com.iterable.iterableapi.IterableDataEncryptor.encrypt(IterableDataEncryptor.kt:131)
       at com.iterable.iterableapi.IterableKeychain.secureSave(IterableKeychain.kt:87)
       at com.iterable.iterableapi.IterableKeychain.saveEmail(IterableKeychain.kt:92)
       at com.iterable.iterableapi.IterableApi.storeAuthData(IterableApi.java:435)
       at com.iterable.iterableapi.IterableApi.setEmail(IterableApi.java:741)
       at com.iterable.iterableapi.IterableApi.setEmail(IterableApi.java:713)
       ...
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180)
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:138)
       at androidx.startup.AppInitializer.initializeComponent(AppInitializer.java:117)
       ...
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6998)
       at android.app.ActivityThread.-$$Nest$mhandleBindApplication()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:205)
       at android.os.Looper.loop(Looper.java:294)
       at android.app.ActivityThread.main(ActivityThread.java:8177)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions