Skip to content

Issue 1 - Composable swallowing exceptions #6

@danimontoya

Description

@danimontoya

Android Studio Build:

Android Studio 4.0 Canary 8
Build #AI-193.5233.102.40.6107147, built on January 2, 2020
Runtime version: 1.8.0_212-release-1586-b4-5784211 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.6
GC: ParNew, ConcurrentMarkSweep
Memory: 4012M
Cores: 12
Registry: ide.new.welcome.screen.force=true, ide.balloon.shadow.size=0
Non-Bundled Plugins: com.chrisrm.idea.MaterialThemeUI, com.squareup.sqldelight

Version of Gradle Plugin:

4.0.0-alpha08

Version of Gradle:

gradle-6.1-rc-1-all

Version of Java:

1.8

OS:

MacOs Mojave 10.14.6

Steps to Reproduce:

  • Using ModalDrawerLayout from material
  • When exception happens in drawerContent / bodyContent the stacktrace is lost and, instead, will be thrown an IllegalStateException: no stage finishing is allowed while read is disabled.

Sample branch:
https://github.com/arrow-kt/compose-samples/blob/gotchas/gist1/JetNews/app/src/main/java/com/example/jetnews/MainActivity.kt

Stacktrace:

Details
2020-01-13 16:31:00.973 15824-15824/com.example.jetnews E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.jetnews, PID: 15824
    java.lang.IllegalStateException: no stage finishing is allowed while read is disabled
        at androidx.ui.core.NodeStagesModelObserver.afterStage(NodeStagesModelObserver.kt:165)
        at androidx.ui.core.AndroidComposeView.onEndMeasure(AndroidOwner.kt:391)
        at androidx.ui.core.LayoutNode.measure(ComponentNodes.kt:1210)
        at androidx.ui.layout.ContainerKt$Container$1$1$1.invoke(Container.kt:98)
        at androidx.ui.layout.ContainerKt$Container$1$1$1.invoke(Unknown Source:3)
        at androidx.ui.core.MeasureScope$layout$1.placeChildren(MeasureScope.kt:65)
        at androidx.ui.core.LayoutNode.placeChildren(ComponentNodes.kt:1250)
        at androidx.ui.core.LayoutNode$InnerPlaceable.performPlace(ComponentNodes.kt:1067)
        at androidx.ui.core.Placeable$PlacementScope.place(Placeable.kt:68)
        at androidx.ui.core.Placeable$PlacementScope.place(Placeable.kt:81)
        at androidx.ui.core.AndroidComposeView$Companion$RootMeasureBlocks$1$measure$2.invoke(AndroidOwner.kt:642)
        at androidx.ui.core.AndroidComposeView$Companion$RootMeasureBlocks$1$measure$2.invoke(AndroidOwner.kt:631)
        at androidx.ui.core.MeasureScope$layout$1.placeChildren(MeasureScope.kt:65)
        at androidx.ui.core.LayoutNode.placeChildren(ComponentNodes.kt:1250)
        at androidx.ui.core.AndroidComposeView$measureAndLayout$$inlined$trace$lambda$1.invoke(AndroidOwner.kt:349)
        at androidx.ui.core.AndroidComposeView$measureAndLayout$$inlined$trace$lambda$1.invoke(AndroidOwner.kt:59)
        at androidx.compose.frames.FramesKt.observeAllReads(Frames.kt:166)
        at androidx.ui.core.NodeStagesModelObserver.observeReads(NodeStagesModelObserver.kt:142)
        at androidx.ui.core.AndroidComposeView.measureAndLayout$ui_platform_release(AndroidOwner.kt:335)
        at androidx.ui.core.AndroidComposeView.onLayout(AndroidOwner.kt:404)
        at android.view.View.layout(View.java:20672)
        at android.view.ViewGroup.layout(ViewGroup.java:6194)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
        at android.view.View.layout(View.java:20672)
        at android.view.ViewGroup.layout(ViewGroup.java:6194)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
        at android.view.View.layout(View.java:20672)
        at android.view.ViewGroup.layout(ViewGroup.java:6194)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
        at android.view.View.layout(View.java:20672)
        at android.view.ViewGroup.layout(ViewGroup.java:6194)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
        at android.view.View.layout(View.java:20672)
        at android.view.ViewGroup.layout(ViewGroup.java:6194)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
        at com.android.internal.policy.DecorView.onLayout(DecorView.java:753)
        at android.view.View.layout(View.java:20672)
        at android.view.ViewGroup.layout(ViewGroup.java:6194)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2792)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2319)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
        at android.view.Choreographer.doCallbacks(Choreographer.java:761)
        at android.view.Choreographer.doFrame(Choreographer.java:696)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
2020-01-13 16:31:00.973 15824-15824/com.example.jetnews E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions