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)