c***@163.com
c***@163.com
  • 发布:2022-02-11 00:39
  • 更新:2022-02-11 08:49
  • 阅读:528

【报Bug】app部分手机崩溃

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: Alpha

HBuilderX版本号: 3.3.11

手机系统: Android

手机系统版本号: Android 10

手机厂商: 华为

手机机型: ALL

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

ctx = uni.createCanvasContext(this.id, this)
ctx.drawImage('/static/image/invitaion/postcard_default.png', 0, 0, this.width, this.height)
ctx.draw()
let width = this.width 1.5
let positionY = 270
ctx.drawImage('/static/image/invitaion/poster_bottom.png', this.width / 2 - width / 2, positionY, width,
this
.height)
ctx.draw(true)
let logoWidth = 50;
ctx.drawImage('/static/image/logo.png', this.width / 2 - logoWidth / 2, positionY + 30, logoWidth,
logoWidth)
ctx.draw(true)
ctx.setFontSize(10)
ctx.setTextAlign('center')
ctx.setFillStyle('#000000')
ctx.fillText('布丁影视', this.width / 2, positionY + 30 + 70)
let top = positionY + 30 + 70;
let startX = this.width / 2 - (this.qrcodeSize + this.margin
2) / 2
let backgroundColor = '#ffffff'
let foregroundColor = '#000000'
ctx.drawImage('/static/image/invitaion/poster_qr_bg.png', startX, top, this.qrcodeSize + this.margin 2,
this.qrcodeSize + this.margin
2)
for (var row = 0; row < this.modules.length; row++) {
for (var col = 0; col < this.modules.length; col++) {
// 计算每一个小块的位置
var x = col this.tileSize + this.margin
var y = row
this.tileSize + this.margin
var w = this.tileSize
var h = this.tileSize

                        var style = this.modules[row][col] ? foregroundColor : backgroundColor  
                        ctx.setFillStyle(style)  
                        ctx.fillRect(startX + x, top + y, w, h)  
                    }  
                }  
                ctx.setFontSize(14)  
                ctx.setTextAlign('center')  
                ctx.setFillStyle('#000000')  
                ctx.fillText('邀请码:' + this.code + '(长按复制)', this.width / 2, positionY + 30 + 70 + 115)  
                ctx.draw(true)  
                ctx.save()

操作步骤:

具体不清楚,看日志是canvas

预期结果:

正常

实际结果:

崩溃

bug描述:

2022/02/10 05:09:12 [crash] imei: md:V1936A p:a os:30 net:6 vb:1.9.9.81222 mc: appid:UNIECA0135 appcount:1 wvcount:2 pn:com.bdingmovie mem:10088kb etype:1 eurl: carsh_info:java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@ee0c7b0
at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:89)
at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:280)
at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:151)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:548)
at android.widget.ImageView.onDraw(ImageView.java:1433)
at android.view.View.draw(View.java:22661)
at android.view.View.updateDisplayListIfDirty(View.java:21498)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at android.view.View.updateDisplayListIfDirty(View.java:21489)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at android.view.View.updateDisplayListIfDirty(View.java:21489)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at android.view.View.draw(View.java:22664)
at android.view.View.updateDisplayListIfDirty(View.java:21498)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at android.view.View.updateDisplayListIfDirty(View.java:21489)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at android.view.View.updateDisplayListIfDirty(View.java:21489)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at io.dcloud.common.core.ui.k.drawChild(SourceFile:2)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at io.dcloud.common.core.ui.a$l.dispatchDraw(SourceFile:1)
at android.view.View.draw(View.java:22664)
at android.view.View.updateDisplayListIfDirty(View.java:21498)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at android.view.View.updateDisplayListIfDirty(View.java:21489)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at android.view.View.updateDisplayListIfDirty(View.java:21489)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at android.view.View.updateDisplayListIfDirty(View.java:21489)
at android.view.View.draw(View.java:22361)
at android.view.ViewGroup.drawChild(ViewGroup.java:4581)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4334)
at android.view.View.draw(View.java:22664)
at com.android.internal.policy.DecorView.draw(DecorView.java:926)
at android.view.View.updateDisplayListIfDirty(View.java:21498)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:581)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:587)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:687)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4468)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4191)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3442)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2211)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8720)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1031)
at android.view.Choreographer.doCallbacks(Choreographer.java:849)
at android.view.Choreographer.doFrame(Choreographer.java:779)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1016)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:257)
at android.app.ActivityThread.main(ActivityThread.java:8228)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1016)

2022-02-11 00:39 负责人:无 分享
已邀请:
BoredApe

BoredApe - 有问题就会有答案。

请上传一个能重现问题的测试工程

该问题目前已经被锁定, 无法添加新回复