# Reader ANR on generateKey

**URL:** <https://developer.squareup.com/forums/t/reader-anr-on-generatekey/16834>\
**Category:** Questions\
**Tags:** reader-sdk\
**Created:** [May 21, 2024, 2:26pm UTC](https://developer.squareup.com/forums/t/reader-anr-on-generatekey/16834 "2024-05-21T14:26:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![keithpic](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/keithpic/32/6305_2.png) [@keithpic](https://developer.squareup.com/forums/u/keithpic)\
**Post date:** [May 21, 2024, 2:26pm UTC](https://developer.squareup.com/forums/t/reader-anr-on-generatekey/16834/1 "2024-05-21T14:26:19Z")

</div>

Hi,

A user of ours is receiving an ANR when using their Lenovo TB125FU (Lenovo Tab M10 Plus 3rd Gen) and the Square Reader SDK.

Google Play returns the following crash:

```auto
at android.os.BinderProxy.transactNative (Native method)
This Binder call may be taking too long, causing the main thread to wait, and triggering the ANR.

```

```auto
"main" tid=1 Native
  #00 pc 0x00000000000ac184 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
  #01 pc 0x000000000005dc9c /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
  #02 pc 0x000000000005b3ac /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+284)
  #03 pc 0x000000000005c768 /system/lib64/libbinder.so (android::IPCThreadState::waitForResponse+72)
  #04 pc 0x000000000005c458 /system/lib64/libbinder.so (android::IPCThreadState::transact+216)
  #05 pc 0x0000000000053a3c /system/lib64/libbinder.so (android::BpBinder::transact+188)
  #06 pc 0x000000000017492c /system/lib64/libandroid_runtime.so (android_os_BinderProxy_transact+188)
  at android.os.BinderProxy.transactNative (Native method)
  at android.os.BinderProxy.transact (BinderProxy.java:591)
  at android.system.keystore2.IKeystoreSecurityLevel$Stub$Proxy.generateKey (IKeystoreSecurityLevel.java:259)
  at android.security.KeyStoreSecurityLevel.lambda$generateKey$0$android-security-KeyStoreSecurityLevel (KeyStoreSecurityLevel.java:145)
  at android.security.KeyStoreSecurityLevel$$ExternalSyntheticLambda1.execute (unavailable:12)
  at android.security.KeyStoreSecurityLevel.handleExceptions (KeyStoreSecurityLevel.java:55)
  at android.security.KeyStoreSecurityLevel.generateKey (KeyStoreSecurityLevel.java:145)
  at android.security.keystore2.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPairHelper (AndroidKeyStoreKeyPairGeneratorSpi.java:690)
  at android.security.keystore2.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPair (AndroidKeyStoreKeyPairGeneratorSpi.java:627)
  at java.security.KeyPairGenerator$Delegate.generateKeyPair (KeyPairGenerator.java:746)
  at com.squareup.cryptoattestation.compatibilitycheck.KeyStoreCipherUtilities.generateKey (KeyStoreCipherUtilities.kt:91)
  at com.squareup.cryptoattestation.compatibilitycheck.KeyStoreCipherUtilities.generateKey (KeyStoreCipherUtilities.kt:53)
  at com.squareup.cryptoattestation.compatibilitycheck.RealKeyProvisionCompatibilityChecker.testKeyGeneration (RealKeyProvisionCompatibilityChecker.kt:226)
  at com.squareup.cryptoattestation.compatibilitycheck.RealKeyProvisionCompatibilityChecker.generateReport (RealKeyProvisionCompatibilityChecker.kt:154)
  at com.squareup.cryptoattestation.compatibilitycheck.RealKeyProvisionCompatibilityChecker.getReport (RealKeyProvisionCompatibilityChecker.kt:103)
  at com.squareup.cryptoattestation.compatibilitycheck.RealKeyProvisionCompatibilityChecker.meetsRequirement (RealKeyProvisionCompatibilityChecker.kt:118)
  at com.squareup.encryption.RealHieroglyphKeyProviderRequirementChecker$meetsRequirement$2.invoke (RealHieroglyphKeyProviderRequirementChecker.kt:22)
  at com.squareup.encryption.RealHieroglyphKeyProviderRequirementChecker$meetsRequirement$2.invoke (RealHieroglyphKeyProviderRequirementChecker.kt:20)
  at kotlin.SynchronizedLazyImpl.getValue (LazyJVM.kt:74)
.... (more stack available if requested)

```

This device is listed as [compatible](https://squareup.com/ca/en/compatibility?platform=Android&brand=Lenovo&model=Tab%20M10%20Plus%203rd%20Gen). It is running Android 13 (SDK 33).

We are running Reader version `1.7.5` and targeting android sdk 33.

Any advice or help would be appreciated. I am happy to provide more info on request.

Thanks!

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 6, 2024, 10:01pm UTC](https://developer.squareup.com/forums/t/reader-anr-on-generatekey/16834/4 "2024-08-06T22:01:58Z")

</div>

Just realized there was no follow up here. Were you able to figure out the issue? 🙂

---

<div class="post-metadata">

**Author:** ![keithpic](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/keithpic/32/6305_2.png) [@keithpic](https://developer.squareup.com/forums/u/keithpic)\
**Post date:** [August 7, 2024, 6:28pm UTC](https://developer.squareup.com/forums/t/reader-anr-on-generatekey/16834/6 "2024-08-07T18:28:18Z")

</div>

Hi Bryan,  
No, we have not heard of a solution yet. I assumed it was something with the hardware, or how Square interacts with the device itself.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 7, 2024, 6:51pm UTC](https://developer.squareup.com/forums/t/reader-anr-on-generatekey/16834/7 "2024-08-07T18:51:59Z")

</div>

Are you are performing network requests, heavy computations, or any other long-running operations on the main thread, it can block the UI thread and lead to ANR? Or making synchronous IPC calls that take a long time to complete can block the main thread? Performing complex or heavy UI operations on the main thread can also contribute to this issue. 🙂
