flurry / flurry-android-sdk

Flurry Android SDK API reference documentation
Apache License 2.0
21 stars 3 forks source link

Crashes on HTC U11 Android 9 devices during SDK v12.0.1 Initialization - android.security.KeyStoreException #10

Closed leophoenixia closed 3 years ago

leophoenixia commented 4 years ago

SDK Version:

12.0.1

Devices & Android Version:

HTC U11 Android 9

Issue Description:

Crash reports from users and Play Console after upgrading the SDK version to 12.0.1, which was working fine in 11.6@aar.

Exception:

Caused by android.security.KeyStoreException
android.security.KeyStore.getKeyStoreException (KeyStore.java:839)
android.security.keystore.AndroidKeyStoreKeyGeneratorSpi.engineGenerateKey (AndroidKeyStoreKeyGeneratorSpi.java:324)
javax.crypto.KeyGenerator.generateKey (KeyGenerator.java:612)
com.flurry.sdk.ah.<init> (SourceFile:54)
com.flurry.sdk.ag.<init> (SourceFile:59)
com.flurry.sdk.ae.<init> (SourceFile:41)
com.flurry.sdk.n.<init> (SourceFile:1067)
com.flurry.sdk.n.a (SourceFile:48)
com.flurry.sdk.bn.<init> (SourceFile:42)
com.flurry.sdk.bs.<init> (SourceFile:24)
com.flurry.sdk.ew.<init> (SourceFile:37)
com.flurry.sdk.ez.<init> (SourceFile:1014)
com.flurry.sdk.ez.a (SourceFile:30)
com.flurry.android.FlurryAgent$Builder.build (SourceFile:1119)

Code Snippet:

new FlurryAgent.Builder()
    .withCaptureUncaughtExceptions(true)
    .withIncludeBackgroundSessionsInMetrics(true)
    .withLogLevel(Log.VERBOSE)
    .withPerformanceMetrics(FlurryPerformance.All)
    .build(context, context.getString(R.string.flurry_api_key));
pai-vz commented 4 years ago

Hi @leophoenixia,

I'm so sorry to hear that Flurry Analytics SDK caused app crash. I did some investigation about the issue and found that we did use try-catch to catch KeyStoreException in com.flurry.sdk.ah.. But for some mysterious reason, it doesn't work properly. I will look deep into it and see what's wrong.

BTW, may I ask how many users were affected by this issue? And how many related crashes did you see from either Flurry dashboard or Google play console?

Regards, Pai

leophoenixia commented 4 years ago

Thanks for help @pai-vz,

It was a 20 something (all HTC U11 devices with Android 9) for few hours before we did a quick fix going back to 11.6. I didn't find any related crashes and all crashes are from Play console, no reports from Flurry.

Seems like a device specific issue but not sure if this also shows up on other devices. Hope this help. Thanks.

pai-vz commented 4 years ago

@leophoenixia Thanks for update!

We are still investigating why try-catch doesn't work for HTC U11. We will order HTC U11 device to test.

leophoenixia commented 4 years ago

@pai-vz Thanks so much!

poting-oath commented 3 years ago

@leophoenixia Fix is available for releases 12.1.0 and after. Please verify! Thanks!

leophoenixia commented 3 years ago

@poting-oath Tested with 12.9.0 and is working perfectly. Thanks!