zhk
zhk
  • 发布:2022-11-14 16:56
  • 更新:2023-05-08 14:18
  • 阅读:1926

【报Bug】无法启动 Canvas: trying to draw too large(125428800bytes) bitmap.

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win11

HBuilderX类型: 正式

HBuilderX版本号: 3.6.4

手机系统: Android

手机系统版本号: Android 12

手机厂商: 小米

手机机型: 红米K50Pro

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

操作步骤:

启动就报错。

预期结果:

启动就报错。

实际结果:

启动就报错。

bug描述:

启动不起来,错误如下:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.topevery.index.evaluation, PID: 29069
java.lang.RuntimeException: Canvas: trying to draw too large(125428800bytes) bitmap.
at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:266)
at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:94)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:549)
at android.view.View.getDrawableRenderNode(View.java:23504)
at android.view.View.drawBackground(View.java:23402)
at android.view.View.draw(View.java:23134)
at android.view.View.updateDisplayListIfDirty(View.java:21976)
at android.view.View.draw(View.java:22860)
at android.view.ViewGroup.drawChild(ViewGroup.java:4602)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4360)
at android.view.View.updateDisplayListIfDirty(View.java:21967)
at android.view.View.draw(View.java:22860)
at android.view.ViewGroup.drawChild(ViewGroup.java:4602)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4360)
at android.view.View.updateDisplayListIfDirty(View.java:21967)
at android.view.View.draw(View.java:22860)
at android.view.ViewGroup.drawChild(ViewGroup.java:4602)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4360)
at android.view.View.updateDisplayListIfDirty(View.java:21967)
at android.view.View.draw(View.java:22860)
at android.view.ViewGroup.drawChild(ViewGroup.java:4602)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4360)
at android.view.View.draw(View.java:23158)
at com.android.internal.policy.DecorView.draw(DecorView.java:888)
at android.view.View.updateDisplayListIfDirty(View.java:21976)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:534)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:542)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:625)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4859)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4565)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3654)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2381)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9359)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1152)
at android.view.Choreographer.doCallbacks(Choreographer.java:918)
at android.view.Choreographer.doFrame(Choreographer.java:833)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1137)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8307)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:577)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1073)
W/cr_PlatformSer-Internal: GMS is installed but not enabled
E/chromium: [ERROR:network_service_instance_impl.cc(179)] Failed to grant sandbox access to network context data for /data/user/0/com.topevery.index.evaluation/app_webview/Default with result 7: No such file or directory (2)
D/CompatibilityChangeReporter: Compat change id reported: 171228096; UID 10351; state: ENABLED
I/System.out: [okhttp]:check permission begin!
W/System: ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out: [okhttp] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils
I/System.out: [com.mediatek.cta.CtaAdapter]:check permission begin!
W/System: ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out: [com.mediatek.cta.CtaAdapter] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils
I/ndex.evaluatio: Thread[5,tid=29088,WaitingInMainSignalCatcherLoop,Thread=0x7c705eb000,peer=0x12e40000,"Signal Catcher"]: reacting to signal 3
I/ndex.evaluatio: Wrote stack traces to tombstoned
I/System.out: [OkHttp] sendRequest>>
I/System.out: [OkHttp] sendRequest<<
W/MIUIScout App: Enter APP_SCOUT_WARNING State
W/MIUIScout App: Event:APP_SCOUT_WARNING Thread:main backtrace:
at java.lang.Thread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:451)
at java.lang.Thread.sleep(Thread.java:356)
at io.dcloud.common.adapter.util.UEH$1.uncaughtException(Unknown Source:7)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2200)
I/ndex.evaluatio: Thread[5,tid=29088,WaitingInMainSignalCatcherLoop,Thread
=0x7c705eb000,peer=0x12e40000,"Signal Catcher"]: reacting to signal 3
I/ndex.evaluatio: Wrote stack traces to tombstoned
W/System.err: java.lang.RuntimeException: Canvas: trying to draw too large(125428800bytes) bitmap.
at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:266)
W/System.err: at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:94)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:549)
at android.view.View.getDrawableRenderNode(View.java:23504)
at android.view.View.drawBackground(View.java:23402)
W/System.err: at android.view.View.draw(View.java:23134)
at android.view.View.updateDisplayListIfDirty(View.java:21976)
at android.view.View.draw(View.java:22860)
at android.view.ViewGroup.drawChild(ViewGroup.java:4602)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4360)
W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:21967)
at android.view.View.draw(View.java:22860)
at android.view.ViewGroup.drawChild(ViewGroup.java:4602)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4360)
W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:21967)
at android.view.View.draw(View.java:22860)
at android.view.ViewGroup.drawChild(ViewGroup.java:4602)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4360)
at android.view.View.updateDisplayListIfDirty(View.java:21967)
W/System.err: at android.view.View.draw(View.java:22860)
at android.view.ViewGroup.drawChild(ViewGroup.java:4602)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4360)
at android.view.View.draw(View.java:23158)
W/System.err: at com.android.internal.policy.DecorView.draw(DecorView.java:888)
at android.view.View.updateDisplayListIfDirty(View.java:21976)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:534)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:542)
W/System.err: at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:625)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4859)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4565)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3654)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2381)
W/System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9359)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1152)
at android.view.Choreographer.doCallbacks(Choreographer.java:918)
at android.view.Choreographer.doFrame(Choreographer.java:833)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1137)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8307)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:577)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1073)
E/UncaughtExceptionHandler: java.lang.RuntimeException: Canvas: trying to draw too large(125428800bytes) bitmap.
I/Process: Sending signal. PID: 29069 SIG: 9
Disconnected from the target VM, address: 'localhost:13345', transport: 'socket'

2022-11-14 16:56 负责人:DCloud_Android_ST 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

图像数据过大,可以具体描述一下你的代码逻辑。

  • zhk (作者)

    可是这个项目都没有大的图片呀,我全部图片加起来才700多kb,也不像异常里面说的这么大

    2022-11-16 13:34

  • DCloud_UNI_GSQ

    回复 zhk: 可以具体描述一下你的代码逻辑,或者提供可复现的项目,以便进一步定位问题

    2022-11-16 21:03

aak12345

aak12345

我也遇到。。。。android 10手机正常。就是12不正常。。。。小米11

aak12345

aak12345

我这边是离线打包的,我把splash页面,删掉就正常了

aak12345

aak12345

https://www.jianshu.com/p/ab31fcdeda9c 参考方法二,把启动图片放在drawable-nodpi下面,解决。

1***@qq.com

1***@qq.com

启动页图片1242*2688的webp 44.75kb在附件图手机上启动就闪退
安卓报错日志java.lang.RuntimeException: Canvas: trying to draw too large(120185856bytes) bitmap.
at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:97)

要回复问题请先登录注册