Creator 2.4.0 Native: UpdateMeshAttribute crashes, because of this._assebler is null

Android native build crash after attempt to open new scene

I think, your project codes have some issues?

I’ve tested 2.4.0’s example cases on native Android and everything worked fine.

I updated my project from Creator 2.3.1 to 2.4.0. Ios project does not work too. In previous version all worked fine

@zzf_Cocos @SantyWang @jare could you check this issue

I think the scene’s json has been corrupted somehow. maybe you can find some places like "_components": null in the .fire file. you can change it to "_components" : []

The problem is not in the scene.


UpdateMeshAttribute does not work correctly, because of this._assebler is null. In our project we dynamically create node with MeshRenderer, game crashes when we set mesh in meshRenderer component. What should we do?

@SantyWang could you check it

Oh, Sorry, we’ll check it

Maybe you should first add MeshRenderer node to scene (which will create the assembler) before set mesh.

This is sample code that creates node wish mesh renderer

        this._highlightNode.is3DNode = true;
        this._highlightNode.active = false;
        this._highlightNode.eulerAngles = meshNode.eulerAngles;
        this._highlightNode.parent = this.bodyContainer; // adding node to scene
        this._highlightNode.scale = this.HIGHLIGHT_SCALE;
        const meshRenderer: cc.MeshRenderer = this._highlightNode.addComponent(cc.MeshRenderer);
        meshRenderer.mesh = meshNode.getComponent(cc.MeshRenderer).mesh;
        meshRenderer.setMaterial(0, CocosAssetsLoader.getAsset(AssetsNames.MATERIAL_TILE_HIGHLIGHT) as cc.Material);```
As you can see we set mesh after node has been added to scene.

@jjyinkailejj have you checked this issue?

@SantyWang @jjyinkailejj have you checked this issue?

@slackmoehrle @SantyWang @jjyinkailejj could you take a look on this issue?

I’ll ping the engineering team and ask how this is going.

@TiniovyKit sorry for the late reply.

This is because your highlightNode active is false, the MeshRenderer will not create the internal assembler.

You can deactive the highlightNode after setting mesh to solve this problem. We may need to add protection check internally.

Thanks for your feedback.