Francesc
07/11/2021, 1:41 AMnapperley
07/11/2021, 2:44 AMFrancesc
07/11/2021, 2:55 AMgildor
07/11/2021, 2:59 PMFrancesc
07/11/2021, 4:04 PM07-10 18:33:45.845 30889 30889 E AndroidRuntime: FATAL EXCEPTION: main
07-10 18:33:45.845 30889 30889 E AndroidRuntime: Process: <http://com.example.myapp.app|com.example.myapp.app>, PID: 30889
07-10 18:33:45.845 30889 30889 E AndroidRuntime: java.lang.NullPointerException
07-10 18:33:45.845 30889 30889 E AndroidRuntime: at kotlinx.coroutines.scheduling.a.g(Unknown Source:4)
07-10 18:33:45.845 30889 30889 E AndroidRuntime: at kotlinx.coroutines.scheduling.a.h(Unknown Source:11)
07-10 18:33:45.845 30889 30889 E AndroidRuntime: at kotlinx.coroutines.scheduling.c.N(Unknown Source:7)
07-10 18:33:45.845 30889 30889 E AndroidRuntime: at kotlinx.coroutines.internal.h.b(Unknown Source:33)
07-10 18:33:45.845 30889 30889 E AndroidRuntime: at f5.a.c(Unknown Source:15)
07-10 18:33:45.845 30889 30889 E AndroidRuntime: at f5.a.d(Unknown Source:5)
07-10 18:33:45.845 30889 30889 E AndroidRuntime: at b5.h.c(Unknown Source:74)
07-10 18:33:45.845 30889 30889 E AndroidRuntime: at b5.g.c(Unknown Source:0)
07-10 18:33:45.845 30889 30889 E AndroidRuntime: at com.example.myapp.app.feature.feature.one.FeatureAViewModel.M0(Unknown Source:78)
07-10 18:33:45.845 30889 30889 E
Francesc
07/11/2021, 6:05 PMretrace.sh
nor proguardgui
deobfuscated the trace. Looking at the mapping.txt
file, I can make these links
07-11 10:31:28.815 4469 4469 E AndroidRuntime: at kotlinx.coroutines.scheduling.a.g(Unknown Source:4)
07-11 10:31:28.815 4469 4469 E AndroidRuntime: at kotlinx.coroutines.scheduling.a.h(Unknown Source:11)
07-11 10:31:28.815 4469 4469 E AndroidRuntime: at kotlinx.coroutines.scheduling.c.N(Unknown Source:7)
kotlinx.coroutines.scheduling.CoroutineScheduler -> kotlinx.coroutines.scheduling.a:
kotlinx.coroutines.internal.Symbol NOT_IN_STACK -> p
kotlinx.coroutines.scheduling.GlobalQueue globalBlockingQueue -> k
java.lang.String schedulerName -> i
kotlinx.coroutines.scheduling.GlobalQueue globalCpuQueue -> j
java.util.concurrent.atomic.AtomicReferenceArray workers -> l
java.util.concurrent.atomic.AtomicIntegerFieldUpdater _isTerminated$FU -> o
long idleWorkerKeepAliveNs -> h
int corePoolSize -> f
int maxPoolSize -> g
java.util.concurrent.atomic.AtomicLongFieldUpdater parkedWorkersStack$FU -> m
java.util.concurrent.atomic.AtomicLongFieldUpdater controlState$FU -> n
void signalCpuWork() -> C
boolean tryCreateWorker(long) -> D
boolean tryCreateWorker$default(kotlinx.coroutines.scheduling.CoroutineScheduler,long,int,java.lang.Object) -> I
boolean tryUnpark() -> L
int createNewWorker() -> a
kotlinx.coroutines.scheduling.Task createTask(java.lang.Runnable,kotlinx.coroutines.scheduling.TaskContext) -> b
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker currentWorker() -> e
void dispatch(java.lang.Runnable,kotlinx.coroutines.scheduling.TaskContext,boolean) -> g
void dispatch$default(kotlinx.coroutines.scheduling.CoroutineScheduler,java.lang.Runnable,kotlinx.coroutines.scheduling.TaskContext,boolean,int,java.lang.Object) -> h
boolean isTerminated() -> k
int parkedWorkersStackNextIndex(kotlinx.coroutines.scheduling.CoroutineScheduler$Worker) -> l
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker parkedWorkersStackPop() -> m
boolean parkedWorkersStackPush(kotlinx.coroutines.scheduling.CoroutineScheduler$Worker) -> o
void parkedWorkersStackTopUpdate(kotlinx.coroutines.scheduling.CoroutineScheduler$Worker,int,int) -> s
void runSafely(kotlinx.coroutines.scheduling.Task) -> v
void shutdown(long) -> w
07-11 10:31:28.815 4469 4469 E AndroidRuntime: at kotlinx.coroutines.internal.h.b(Unknown Source:33)
kotlinx.coroutines.internal.DispatchedContinuationKt -> kotlinx.coroutines.internal.h:
kotlinx.coroutines.internal.Symbol UNDEFINED -> a
kotlinx.coroutines.internal.Symbol REUSABLE_CLAIMED -> b
kotlinx.coroutines.internal.Symbol access$getUNDEFINED$p() -> a
void resumeCancellableWith(kotlin.coroutines.Continuation,java.lang.Object,kotlin.jvm.functions.Function1) -> b
void resumeCancellableWith$default(kotlin.coroutines.Continuation,java.lang.Object,kotlin.jvm.functions.Function1,int,java.lang.Object) -> c
boolean yieldUndispatched(kotlinx.coroutines.internal.DispatchedContinuation) -> d
the code that appears to crash, in onStart
is subscribing to a flow
timerJob = timerService
.runningFlow
.onEach { running ->
if (preferences.keepScreenOn) {
if (running) {
window?.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
} else {
window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
}
invalidateOptionsMenu()
overflowVisible = !running
}
.launchIn(lifecycleScope)
I'll keep messing with it to see if I can get retrace.sh
to provide any useful infoFrancesc
07/11/2021, 10:00 PMFATAL EXCEPTION: main
Process: com.example.myapp.app.dev, PID: 5527
java.lang.NullPointerException
at kotlinx.coroutines.scheduling.CoroutineScheduler.dispatch(:384)
at kotlinx.coroutines.scheduling.CoroutineScheduler.dispatch$default(:383)
at kotlinx.coroutines.scheduling.ExperimentalCoroutineDispatcher.dispatch(:66)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(:332)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(:30)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(:25)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(:170)
at kotlinx.coroutines.BuildersKt.withContext(:1)
at com.example.myapp.app.feature.full.FeatureAViewModel.matchPreset(:860)
at com.example.myapp.app.feature.full.FeatureAViewModel.access$matchPreset(:60)
at com.example.myapp.app.feature.full.FeatureAViewModel$launchMatchPreset$1.invokeSuspend(:875)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(:33)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(:377)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(:30)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(:25)
at kotlinx.coroutines.CoroutineStart.invoke(:110)
at kotlinx.coroutines.AbstractCoroutine.start(:126)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(:56)
at kotlinx.coroutines.BuildersKt.launch(:1)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(:47)
at kotlinx.coroutines.BuildersKt.launch$default(:1)
at com.example.myapp.app.feature.full.FeatureAViewModel.launchMatchPreset(:873)
at com.example.myapp.app.feature.full.FeatureAViewModel.removeNdFilter(:751)
at com.example.myapp.app.feature.full.FeatureAViewModel.setNd1FilterVisibility(:703)
at com.example.myapp.app.feature.full.FeatureAViewModel.setNdFiltersVisibility(:688)
at com.example.myapp.app.feature.full.FeatureAViewModel.setWheelsVisibility(:651)
at com.example.myapp.app.feature.full.FeatureAViewModel.onParamsChanged(:388)
at com.example.myapp.app.feature.full.FeatureAViewModel.start(:364)
at com.example.myapp.app.feature.full.FeatureAViewModel.onStart(:326)
at androidx.lifecycle.FullLifecycleObserverAdapter.onStateChanged(:39)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(:354)
at androidx.lifecycle.LifecycleRegistry.forwardPass(:265)
at androidx.lifecycle.LifecycleRegistry.sync(:307)
at androidx.lifecycle.LifecycleRegistry.moveToState(:148)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(:134)
at androidx.fragment.app.Fragment.performStart(:3024)
at androidx.fragment.app.FragmentStateManager.start(:568)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(:277)
at androidx.fragment.app.FragmentStore.moveToExpectedState(:113)
at androidx.fragment.app.FragmentManager.moveToState(:1327)
at androidx.fragment.app.FragmentManager.dispatchStateChange(:2757)
at androidx.fragment.app.FragmentManager.dispatchStart(:2707)
at androidx.fragment.app.Fragment.performStart(:3028)
at androidx.fragment.app.FragmentStateManager.start(:568)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(:277)
at androidx.fragment.app.FragmentStore.moveToExpectedState(:113)
at androidx.fragment.app.FragmentManager.moveToState(:1327)
at androidx.fragment.app.FragmentManager.dispatchStateChange(:2757)
at androidx.fragment.app.FragmentManager.dispatchStart(:2707)
at androidx.fragment.app.FragmentController.dispatchStart(:273)
at androidx.fragment.app.FragmentActivity.onStart(:486)
at androidx.appcompat.app.AppCompatActivity.onStart(:210)
at com.example.myapp.app.feature.MainActivity.onStart(:161)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435)
at android.app.Activity.performStart(Activity.java:8024)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3475)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Francesc
07/11/2021, 10:00 PMFrancesc
07/11/2021, 10:02 PMflow
was incorrect, the crash happens when I call withContext(Dispatchers.Default
to run some code while in a coroutine context (the viewmodel's)gildor
07/12/2021, 3:38 AMgildor
07/12/2021, 3:39 AMFrancesc
07/12/2021, 3:43 AMJustin
07/12/2021, 3:55 AMandroid.enableR8.fullMode=true
gildor
07/12/2021, 4:05 AMFrancesc
07/12/2021, 4:39 AMandroid.enableR8.fullMode
no
07/12/2021, 6:28 AMFrancesc
07/12/2021, 2:48 PM7.1.0-alpha03
which is the latestJustin
07/12/2021, 2:57 PMalpha02 -> alpha03
, and you're cleaning the project etc, then I can't see how that'd be anything other than a bug in most scenariosJustin
07/12/2021, 3:00 PMFrancesc
07/12/2021, 3:01 PMFrancesc
07/12/2021, 3:02 PMJustin
07/12/2021, 3:03 PMJustin
07/12/2021, 3:04 PMFrancesc
07/12/2021, 3:05 PMno
07/12/2021, 3:40 PMFrancesc
07/13/2021, 11:24 PMFrancesc
07/13/2021, 11:26 PM