# Android application crash after updating to latest square reader sdk on new installs

**URL:** <https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698>\
**Category:** Questions\
**Tags:** reader-sdk\
**Created:** [April 14, 2022, 4:04pm UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698 "2022-04-14T16:04:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![MTW](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MTW](https://developer.squareup.com/forums/u/MTW)\
**Post date:** [April 14, 2022, 4:04pm UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698/1 "2022-04-14T16:04:37Z")

</div>

On a new install of our application we are now getting the following crash after the user clicks “Allow” on all the required permissions:

Scope com.squareup.container.WorkflowScope was destroyed – this crash does not happen when users upgrade from the previous version of our application.

Here is the full stack trace.

java.lang.IllegalStateException: Scope com.squareup.container.WorkflowScope was destroyed  
at shadow.mortar.MortarScope.assertNotDead(MortarScope.java:264)  
at shadow.mortar.MortarScope.findService(MortarScope.java:131)  
at shadow.mortar.MortarScope.getService(MortarScope.java:116)  
at com.squareup.container.inversion.FlowRunnerKt.getFlow(FlowRunner.kt:76)  
at com.squareup.ui.main.GatekeepersRootWorkflow$render$1$1.invokeSuspend(GatekeepersRootWorkflow.kt:99)  
at com.squareup.ui.main.GatekeepersRootWorkflow$render$1$1.invoke(Unknown Source:8)  
at com.squareup.ui.main.GatekeepersRootWorkflow$render$1$1.invoke(Unknown Source:4)  
at com.squareup.workflow1.InterceptedRenderContext$runningSideEffect$withScopeReceiver$1.invokeSuspend(WorkflowInterceptor.kt:306)  
at com.squareup.workflow1.InterceptedRenderContext$runningSideEffect$withScopeReceiver$1.invoke(Unknown Source:8)  
at com.squareup.workflow1.InterceptedRenderContext$runningSideEffect$withScopeReceiver$1.invoke(Unknown Source:2)  
at com.squareup.workflow1.InterceptedRenderContext$runningSideEffect$1$1.invokeSuspend(WorkflowInterceptor.kt:311)  
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)  
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)  
at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:69)  
at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:244)  
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:161)  
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)  
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)  
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)  
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)  
at kotlinx.coroutines.flow.SharedFlowImpl.tryEmit(SharedFlow.kt:368)  
at com.squareup.gatekeeper.Gatekeeping.updateGatekeepers(Gatekeeping.kt:31)  
at com.squareup.ui.main.Historian.nextHistoryToShowWhileResetting(Historian.kt:343)  
at com.squareup.ui.main.Historian.resetHistory(Historian.kt:239)  
at com.squareup.ui.main.WorkflowPosContainer.resetHistory(WorkflowPosContainer.kt:184)  
at com.squareup.ui.systempermissions.EnableDeviceSettingsPresenter.updatePermissionsState(EnableDeviceSettingsPresenter.java:137)  
at com.squareup.ui.systempermissions.EnableDeviceSettingsPresenter.onResume(EnableDeviceSettingsPresenter.java:82)  
at com.squareup.pauses.PauseAndResumePresenter.activityResumed(PauseAndResumePresenter.java:72)  
at com.squareup.ui.main.MainActivity.onResume(MainActivity.java:218)  
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1476)  
at android.app.Activity.performResume(Activity.java:8441)  
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5200)  
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5269)  
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:54)  
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)  
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)  
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)  
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438)  
at android.os.Handler.dispatchMessage(Handler.java:106)  
at android.os.Looper.loopOnce(Looper.java:226)  
at android.os.Looper.loop(Looper.java:313)  
at android.app.ActivityThread.main(ActivityThread.java:8663)  
at java.lang.reflect.Method.invoke(Native Method)  
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)  
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

---

<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:** [April 14, 2022, 5:20pm UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698/2 "2022-04-14T17:20:38Z")

</div>

👋 What’s your application ID and the location ID this happened with? 🙂

---

<div class="post-metadata">

**Author:** ![MTW](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MTW](https://developer.squareup.com/forums/u/MTW)\
**Post date:** [April 14, 2022, 5:33pm UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698/3 "2022-04-14T17:33:25Z")

</div>

Application ID is – sq0idp-6rgRny31WOjf4\_7ggH9XKg , not sure what you mean by location ID?

---

<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:** [April 14, 2022, 5:40pm UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698/4 "2022-04-14T17:40:45Z")

</div>

Your customer has to log into a specific location to process payment. The location\_id will look something like `3Z4V4WHQK64X9`. 🙂

---

<div class="post-metadata">

**Author:** ![MTW](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MTW](https://developer.squareup.com/forums/u/MTW)\
**Post date:** [April 14, 2022, 5:54pm UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698/5 "2022-04-14T17:54:38Z")

</div>

Bryan -

This is in our custom Android application, we are using the Square Reader SDK our customers are not logging into a location.

Does that make sense?

MTW

---

<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:** [April 14, 2022, 9:01pm UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698/6 "2022-04-14T21:01:43Z")

</div>

The [mobile authorization](https://developer.squareup.com/docs/mobile-authz/how-it-works#mobile-authorization-api-process-flow) requires a `location_id` from your customer. Do you know what that `location_id` is? 🙂

---

<div class="post-metadata">

**Author:** ![MTW](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MTW](https://developer.squareup.com/forums/u/MTW)\
**Post date:** [April 15, 2022, 2:50am UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698/7 "2022-04-15T02:50:22Z")

</div>

Bryan -

I am not using mobile authorization as you mentioned, I am using the Square Reader SDK – [https://developer.squareup.com/docs/reader-sdk/build-on-android](https://developer.squareup.com/docs/reader-sdk/build-on-android) – and there is no mention of location ID, nor I have used one in the past as we have been using this SDK for years. It just started NOT working when updating to the latest version.

Thanks - MTW

---

<div class="post-metadata">

**Author:** ![MTW](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MTW](https://developer.squareup.com/forums/u/MTW)\
**Post date:** [April 20, 2022, 7:11pm UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698/8 "2022-04-20T19:11:01Z")

</div>

Bryan -

Do you have any more thoughts on this issue we are having?

Thanks - MTW

---

<div class="post-metadata">

**Author:** ![lepertRSU](https://avatars.discourse-cdn.com/v4/letter/l/e99b99/32.png) [@lepertRSU](https://developer.squareup.com/forums/u/lepertRSU)\
**Post date:** [May 10, 2022, 11:00pm UTC](https://developer.squareup.com/forums/t/android-application-crash-after-updating-to-latest-square-reader-sdk-on-new-installs/5698/9 "2022-05-10T23:00:11Z")

</div>

We are getting this also with Android 12 devices on ReaderSDK 1.5.5 and we tried the upgrade to 1.5.6 and that had same issues and crashed more on Android 12 devices.

We found it was during the initial setup on a clean device with no pairing established. The settings screen seems to work better unpairing and pairing later… but during the first install the ReaderSDK setup crashes.
