Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crash on start - CH 12 #33

Open
chinalwb opened this issue Apr 21, 2022 · 1 comment
Open

App crash on start - CH 12 #33

chinalwb opened this issue Apr 21, 2022 · 1 comment

Comments

@chinalwb
Copy link

Check out the final of Chapter 12 animation.

Build, no problem.
Run, crash, caused by:


E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.raywenderlich.android.jetreddit, PID: 17430
    java.lang.RuntimeException: Canvas: trying to draw too large(132286200bytes) bitmap.
        at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:266)
        at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:97)
        at androidx.compose.ui.graphics.AndroidCanvas.drawImageRect-bgE79EM(AndroidCanvas.kt:275)
        at androidx.compose.ui.graphics.drawscope.CanvasDrawScope.drawImage-Yc2aOMw(CanvasDrawScope.kt:222)
        at androidx.compose.ui.node.LayoutNodeDrawScope.drawImage-Yc2aOMw(LayoutNodeDrawScope.kt:31)
        at androidx.compose.ui.graphics.drawscope.DrawScope$DefaultImpls.drawImage-Yc2aOMw$default(DrawScope.kt:464)
        at androidx.compose.ui.graphics.painter.ImagePainter.onDraw(ImagePainter.kt:55)
        at androidx.compose.ui.graphics.painter.Painter.draw-ty3CEPU(Painter.kt:212)
        at androidx.compose.ui.draw.PainterModifier.draw(PainterModifier.kt:268)
        at androidx.compose.ui.node.ModifiedDrawNode.performDraw(ModifiedDrawNode.kt:102)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:190)
        at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:79)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(LayoutNodeWrapper.kt:204)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(Unknown Source:0)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:131)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:78)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.kt:203)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(Unknown Source:3)
        at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.kt:156)
        at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.kt:193)
        at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.kt:174)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:185)
        at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:79)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:190)
        at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:79)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:190)
        at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:79)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:190)
        at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:800)
        at androidx.compose.ui.node.InnerPlaceable.performDraw(InnerPlaceable.kt:131)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:190)
        at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:79)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:190)
        at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:800)
        at androidx.compose.ui.node.InnerPlaceable.performDraw(InnerPlaceable.kt:131)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(LayoutNodeWrapper.kt:204)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(Unknown Source:0)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:131)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:78)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.kt:203)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(Unknown Source:3)
        at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.kt:156)
        at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.kt:193)
        at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.kt:174)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:185)
E/AndroidRuntime:     at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:79)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:190)
        at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:42)
        at androidx.compose.foundation.Background.draw(Background.kt:104)
        at androidx.compose.ui.node.ModifiedDrawNode.performDraw(ModifiedDrawNode.kt:102)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(LayoutNodeWrapper.kt:204)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(Unknown Source:0)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:131)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:78)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.kt:203)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(Unknown Source:3)
        at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.kt:156)
        at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.kt:193)
        at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.kt:174)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:185)
        at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:79)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(LayoutNodeWrapper.kt:204)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(Unknown Source:0)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:131)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:78)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.kt:203)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(Unknown Source:3)
        at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.kt:156)
        at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.kt:193)
        at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.kt:174)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:185)
        at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:800)
        at androidx.compose.ui.node.InnerPlaceable.performDraw(InnerPlaceable.kt:131)
        at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:190)
        at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:79)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(LayoutNodeWrapper.kt:204)
        at androidx.compose.ui.node.LayoutNodeWrapper$invoke$2.invoke(Unknown Source:0)
        at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:1710)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:126)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:78)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.kt:203)
        at androidx.compose.ui.node.LayoutNodeWrapper.invoke(Unknown Source:3)
        at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.kt:156)
        at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.kt:193)
        at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.kt:535)
        at android.view.View.draw(View.java:23896)
        at android.view.View.updateDisplayListIfDirty(View.java:22762)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5339)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5311)
        at android.view.View.updateDisplayListIfDirty(View.java:22709)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5339)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5311)
        at android.view.View.updateDisplayListIfDirty(View.java:22709)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5339)
E/AndroidRuntime:     at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5311)
        at android.view.View.updateDisplayListIfDirty(View.java:22709)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5339)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5311)
        at android.view.View.updateDisplayListIfDirty(View.java:22709)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5339)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5311)
        at android.view.View.updateDisplayListIfDirty(View.java:22709)
        at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:602)
        at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:608)
        at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:684)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:5305)
        at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5013)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4106)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2831)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10311)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1063)
        at android.view.Choreographer.doCallbacks(Choreographer.java:845)
        at android.view.Choreographer.doFrame(Choreographer.java:780)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1048)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:226)
        at android.os.Looper.loop(Looper.java:313)
        at android.app.ActivityThread.main(ActivityThread.java:8641)
        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:1133)
@chinalwb
Copy link
Author

Move the drawable pics into drawable-xxxhdpi would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant