7***@qq.com
7***@qq.com
  • 发布:2021-10-25 18:43
  • 更新:2021-11-15 11:45
  • 阅读:436

【报Bug】因业务需求,cell标签里面有2层for循环,当list数据大于11必现渲染错误,当数据设置为99时直接抛出java错误,ios正常,安卓必现,系统为鸿蒙系统

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10企业版

HBuilderX类型: 正式

HBuilderX版本号: 3.2.9

手机系统: Android

手机系统版本号: Android 12

手机厂商: 华为

手机机型: mate40E

页面类型: vue

nvue编译模式: 纯nvue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
reportJSException >>>> exception function:callAddElement, exception:arguments is empty, INSTANCE_RENDERING_ERROR will be set  
17:56:26.805 reportJSException >>>> exception function:callAddElement, exception:arguments is empty, INSTANCE_RENDERING_ERROR will be set  
17:56:26.827 reportJSException >>>> exception function:callAddElement, exception:arguments is empty, INSTANCE_RENDERING_ERROR will be set  
17:56:26.845 reportJSException >>>> exception function:callLayout, exception:java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.taobao.weex.ui.component.WXComponent.getComponentType()' on a null object reference  
17:56:26.866 at com.taobao.weex.bridge.WXBridgeManager.setExceedGPULimitComponentsInfo(WXBridgeManager.java:3087)  
17:56:26.886 at com.taobao.weex.bridge.WXBridgeManager.callLayout(WXBridgeManager.java:3302)  
17:56:26.907 at com.taobao.weex.bridge.WXBridge.callLayout(WXBridge.java:705)  
17:56:26.927 at com.taobao.weex.base.SystemMessageHandler.nativeRunWork(Native Method)  
17:56:26.947 at com.taobao.weex.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:104)  
17:56:26.968 at android.os.Handler.dispatchMessage(Handler.java:110)  
17:56:26.988 at android.os.Looper.loop(Looper.java:219)  
17:56:27.008 at android.os.HandlerThread.run(HandlerThread.java:67)  
17:56:27.029 reportJSException >>>> exception function:callLayout, exception:java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.taobao.weex.ui.component.WXComponent.getComponentType()' on a null object reference  
17:56:27.051 at com.taobao.weex.bridge.WXBridgeManager.setExceedGPULimitComponentsInfo(WXBridgeManager.java:3087)  
17:56:27.071 at com.taobao.weex.bridge.WXBridgeManager.callLayout(WXBridgeManager.java:3302)  
17:56:27.092 at com.taobao.weex.bridge.WXBridge.callLayout(WXBridge.java:705)  
17:56:27.113 at com.taobao.weex.base.SystemMessageHandler.nativeRunWork(Native Method)  
17:56:27.134 at com.taobao.weex.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:104)  
17:56:27.155 at android.os.Handler.dispatchMessage(Handler.java:110)  
17:56:27.176 at android.os.Looper.loop(Looper.java:219)  
17:56:27.196 at android.os.HandlerThread.run(HandlerThread.java:67)

操作步骤:

渲染错误

预期结果:

渲染正常

实际结果:

渲染错误

bug描述:

cell标签里面有2层for循环,当数据大于11必现渲染错误,当数据长度为99时直接抛出java错误

2021-10-25 18:43 负责人:无 分享
已邀请:
像素方舟_青阳

像素方舟_青阳

template 代码贴一下

  • 7***@qq.com (作者)

    非常感谢回复,demo已补在下面了

    2021-10-26 17:19

DCloud_Android_ST

DCloud_Android_ST

示例demo提供一下

  • 7***@qq.com (作者)

    demo已补在下方,麻烦看一下

    2021-10-26 17:18

  • 7***@qq.com (作者)

    定义的roomStatelist还有业务在里面,目前已复现问题,故没有继续处理

    2021-10-26 17:20

7***@qq.com

7***@qq.com (作者)

demo已补上,demo种注释代码恢复则不会出现exception function:callLayout, exception:java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.taobao.weex.ui.component.WXComponent.getComponentType()' on a null object reference而是报错渲染问题exception function:callAddElement, exception:arguments is empty, INSTANCE_RENDERING_ERROR will be set

7***@qq.com

7***@qq.com (作者)

<template>  
    <view>  
        <view>  
            <text class="title">这是一个标题</text>  
        </view>  
        <scroller scroll-direction="horizontal"  
            :bounce="false"  
            class="data-container"  
            :show-scrollbar="false"  
            :style="{height: height - 25 +'px'}"  
        >  
            <list :show-scrollbar="false" :bounce="false" :style="{width: `${dateList.length*132}rpx`, height: height+'px'}">  
                <header>  
                    <view class="row">  
                        <view v-for="(item,index) in dateList" class="text-box-column" :key="'date'+index">  
                            <text>{{item.dayOfWeek}}</text>  
                            <view class="date-mile">  
                                <text class="font-size-12">{{item.remainRooms === 0 ? '满房' : `空${item.remainRooms}`}}</text>  
                            </view>  
                        </view>  
                    </view>  
                </header>  
                <cell v-for="(item, i) in roomTypelist" :key="index">  
                    <view>{{item.name}}</view>  
                    <view v-for="($item, $index) in item.rooms" :key="$item+'room'" class="row">  
                        <view v-for="(child,index) in roomStatelist[i][$index]" :key="child.selfId" class="text-box" :style="{  
                                width: child.actualDurationDay?(child.actualDurationDay*132)+'rpx':child.durationDay ? (child.durationDay*132)+'rpx' : '132rpx',  
                                backgroundColor: '#FFFFFF'  
                            }">  
                            <view  
                                :style="{width: child.actualDurationDay ? (child.actualDurationDay*132-4)+'rpx' : child.durationDay ? (child.durationDay*132-4)+'rpx' : '128rpx', top: '1rpx'}"  
                                class="room-detail-info">  
                                <!-- 房段房态详情 -->  
                                <!-- <view style="position: absolute;">  
                                    <view class="room-detail-info-item"  
                                        :style="{  
                                            width: child.actualDurationDay ? (child.actualDurationDay*132-4)+'rpx' : child.durationDay ? (child.durationDay*132-4)+'rpx' : '128rpx',  
                                            justifyContent: 'flex-end'}">  
                                        <view style="flex: 1;" v-if="child.status !== 8 && !child.actualDurationDay">  
                                            <text class="room-detail-item-nomal">{{child.status}}</text>  
                                        </view>  
                                        <view v-if="child.durationDay > 1" style="margin-right: 10rpx;height: 40rpx;">  
                                            <text class="room-detail-item-night">{{`${child.durationDay}间夜`}}</text>  
                                        </view>  
                                    </view>  
                                    <view v-if="!child.actualDurationDay" class="room-detail-info-item">  
                                        <text class="room-detail-item-big"  
                                            :style="{width: child.actualDurationDay ? (child.actualDurationDay*132-4)+'rpx' : child.durationDay ? (child.durationDay*132-4)+'rpx' : '128rpx'}">{{child.name}}</text>  
                                    </view>  
                                    <view v-if="!child.actualDurationDay" class="room-detail-info-item">  
                                        <text class="room-detail-item-nomal">{{child.otaName}}</text>  
                                    </view>  
                                </view> -->  
                            </view>  
                        </view>  
                    </view>  
                </cell>  
            </list>  
        </scroller>  
    </view>  
</template>  

<script>  
    import data from './data.js'  
    export default {  
        data() {  
            return {  
                dateList: data.dateList,  
                roomTypelist: data.roomList,  
                roomStatelist: [],  
                height: 0  
            }  

        },  
        onShow() {  
            this.height = uni.getSystemInfoSync().windowHeight  
            this.roomTypelist.forEach((v, i) => {  
                if (v.rooms && v.rooms.length) {  
                    this.roomStatelist[i] = []  
                    v.rooms.forEach((val, index) => {  
                        const temp = JSON.parse(JSON.stringify(this.dateList))  
                        temp.forEach(k => {  
                            k = Object.assign(k, {  
                                $$checked: false,  
                                selfId: `${k.dayOfMonth}_${val.id}`,  
                                otaName: undefined,  
                                name: undefined,  
                                durationDay: undefined  
                            })  
                        })  
                        this.roomStatelist[i][index] = temp  
                    })  
                }  
            })  
        },  
        methods: {  

        }  
    }  
</script>  

<style>  
    .row{  
        flex-direction: row;  
    }  
    .data-container{  
        width: 750rpx;  
        /* left: 0;  
        top: 0;  
        position: fixed;  
        bottom: 0; */  
        background-color: #FFFFFF;  
    }  
    .text-box-column{  
        height: 128rpx;  
        justify-content: center;  
        flex-direction: column;  
        align-items: center;  
        border-right-width: 1rpx;  
        border-bottom-width: 1rpx;  
        border-top-width: 1rpx;  
        border-color: #EEEEEE;  
        width: 132rpx;  
        color: #FFFFFF;  
        background-color: #FFFFFF;  
    }  
    .text-box {  
        height: 128rpx;  
        justify-content: center;  
        flex-direction: row;  
        align-items: center;  
        border-right-width: 1rpx;  
        border-top-width: 1rpx;  
        border-color: #EEEEEE;  
        background-color: #FFFFFF;  
    }  
    .room-detail-info{  
        /* justify-content: center;  
        align-items: center; */  
        height: 120rpx;  
    }  

    .room-detail-info-item{  
        align-items: flex-start;  
        flex: 1;  
        /* padding-top: 5rpx; */  
        padding-left: 10rpx;  
        flex-direction: row;  
        height: 40rpx;  
    }  
    .room-detail-item-night{  
        font-size: 24rpx;  
        color: #2CC47F;  
        height: 40rpx;  
        line-height: 40rpx;  
    }  

    .room-detail-item-nomal{  
        font-size: 24rpx;  
        line-height: 40rpx;  
    }  
    .room-detail-item-big{  
        font-size: 28rpx;  
        text-overflow: ellipsis;  
        lines: 1;  
        line-height: 40rpx;  
    }  
</style>  
DCloud_Android_ST

DCloud_Android_ST

cpu支持类型勾选arm64-v8a ,然后重新云打包。可以解决该问题

  • 7***@qq.com (作者)

    就是这个demo包,我去勾选了arm64-v8a,测试还是不得行,老师

    2021-10-28 14:18

  • DCloud_Android_ST

    回复 7***@qq.com: 云打包了吗

    2021-10-28 14:28

  • 7***@qq.com (作者)

    回复 DCloud_Android_ST: 真机调试看不到效果吗

    2021-10-28 14:43

  • DCloud_Android_ST

    回复 7***@qq.com: 云打包后生效的

    2021-10-28 14:45

  • 7***@qq.com (作者)

    回复 DCloud_Android_ST: 好的,老师,稍后我调试一下,但是这个问题真机调试是避不开的吗

    2021-10-28 15:31

  • DCloud_Android_ST

    回复 7***@qq.com: 暂时解决问题的方式是这样,已经有人在排查问题了

    2021-10-28 15:34

  • 7***@qq.com (作者)

    回复 DCloud_Android_ST: 可以使用自定义基座调试勾选arm64-v8a的结果吗

    2021-10-28 19:07

  • DCloud_Android_ST

    回复 7***@qq.com: 可以勾选arm64后打自定义基座然后调试开发

    2021-10-28 19:13

  • 7***@qq.com (作者)

    回复 DCloud_Android_ST: 打了自定义基座,勾选了arm64-v8a后,看到的结果是没有报错了,但是最大渲染数是12,剩下的都是空白了,每一层cell表现的都是12个剩下的为空白,目前bug已确认,请问下个版本会修复吗

    2021-10-29 17:41

  • 7***@qq.com (作者)

    顺便问一句,老师,当渲染数量达到一定量级后,点击事件有明显的延迟,目前不晓得原因,感觉cell回收没有效果呢,ios与安卓表现都是这样

    2021-10-29 17:43

  • DCloud_Android_ST

    回复 7***@qq.com: view太多了 可以尝试使用recycle-list https://uniapp.dcloud.io/component/recycle-list

    2021-10-29 18:34

  • 7***@qq.com (作者)

    回复 DCloud_Android_ST: 请问recycle-list可以嵌套使用吗

    2021-11-23 21:57

  • 7***@qq.com (作者)

    因为现在涉及到横向循环和纵向循环,想横向做个模板,纵向做个模板

    2021-11-23 22:00

  • DCloud_Android_ST

    回复 7***@qq.com: recycle-list不支持嵌套

    2021-11-24 11:23

DCloud_Android_ST

DCloud_Android_ST

HX3.2.14已修复

要回复问题请先登录注册