iterable-android-sdk icon indicating copy to clipboard operation
iterable-android-sdk copied to clipboard

NullPointerException calling IterableApi.initialize

Open ruimendesM opened this issue 2 years ago • 6 comments
trafficstars

We recently launch our first version with Iterable SDK on it (version 3.4.14), and we have seen a small number of crashes on the app initialization.

The crash reports a NullPointerException when trying to run the method retrieveEmailAndUserId. getKeychain can return null which can lead to this crash. Can we maybe fallback gracefully on this case instead of crash?

image

Thanks.

ruimendesM avatar Aug 21 '23 08:08 ruimendesM

Hi @ruimendesM , thanks for writing in.

We will take a look into why it returned null and to add additional fallback.

Are there any reproducible steps to it or are these some random occurrence? Are all of them on pixel 6a? Any additional pointers will be super helpful.

Thanks

Ayyanchira avatar Aug 23 '23 17:08 Ayyanchira

Hello @Ayyanchira Unfortunately I was not able to reproduce it yet. It is not specific from Pixel 6a, as we have also seen crashes on an Hisense H40 (Android 10).

ruimendesM avatar Aug 25 '23 14:08 ruimendesM

Thanks for the inputs. Also what percentage of users are getting this crash?

Ayyanchira avatar Aug 25 '23 17:08 Ayyanchira

It was a very small percentage. Less than 1%, but it limits the user from opening the app as we saw multiple crashes associated to the same device.

ruimendesM avatar Aug 26 '23 04:08 ruimendesM

Hi team, we also got hundreds of crashes with v3.4.14. Stacktrace looks like this:

Caused by java.lang.NullPointerException: Attempt to read from field 'java.lang.Object re.x0.d' on a null object reference in method 'void com.pepper.apps.android.app.PepperApplication.onCreate()'
       at com.iterable.iterableapi.IterableKeychain.getEmail(IterableKeychain.java:85)
       at com.iterable.iterableapi.IterableApi.retrieveEmailAndUserId(IterableApi.java:359)
       at com.iterable.iterableapi.IterableApi.initialize(IterableApi.java:512)
       at com.myapp..onCreate(MyApplication.kt:180)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1285)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7261)
       at android.app.ActivityThread.-$$Nest$mhandleBindApplication()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2296)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:240)
       at android.os.Looper.loop(Looper.java:351)
       at android.app.ActivityThread.main(ActivityThread.java:8427)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

Any update ?

LoicJ avatar Sep 19 '23 07:09 LoicJ

Please try using the newly released 3.4.16. We have updated the crypto library to 1.1.0-alpha06 and added some null checks to avoid crashes. Please update this issue if crashes still occur. Will keep this issue active for some time.

Ayyanchira avatar Oct 10 '23 14:10 Ayyanchira