Having trouble in Image loading in iOS 14.1 and higher version

Hi, @slackmoehrle @zzf_Cocos, we are facing a new issue in Ios 14.1, and in the higher version, the image is not showing. In a lower version of Ios and in all Android devices it is showing. I have used this code to load sprite frame.

var inst = this;
    cc.loader.loadRes("Avatar_New", cc.SpriteAtlas, function (err, atlas) {
        for (var i = 1; i < 21; i++) {
            var num = i;
            var n = num.toString();
            var frame = atlas.getSpriteFrame(n);
            inst.avatarImages[i-1] = frame;
            var poolObject = null;
            poolObject = cc.instantiate(inst.avatarPrefab);
            poolObject.getComponent(AvatarSelection).setAvatarImg(frame);
            poolObject.getComponent(AvatarSelection).id = i-1;
            poolObject.active = false;
            inst.avatarPool.push(poolObject);
        }
    });

This is in Ios 14.1 and higher version:-
Screenshot 2021-01-14 at 12.12.45 PM

In Android and in IOS lower than 14.1 :-
Screenshot 2021-01-14 at 12.19.47 PM

Getting issue in IOS 14.1,14.2 and 14.3.

Hello, please give me the atlas asset, I will test.

Hi, @huanxinyin I got a solution, by just adding a little bit of delay in instantiating the prefab. It is working now, thanks.

var inst = this;
    cc.loader.loadRes("Avatar_New", cc.SpriteAtlas, function (err, atlas) {
setTimeout(()=> {
        for (var i = 1; i < 21; i++) {
            var num = i;
            var n = num.toString();
            var frame = atlas.getSpriteFrame(n);
            inst.avatarImages[i-1] = frame;
            var poolObject = null;
            poolObject = cc.instantiate(inst.avatarPrefab);
            poolObject.getComponent(AvatarSelection).setAvatarImg(frame);
            poolObject.getComponent(AvatarSelection).id = i-1;
            poolObject.active = false;
            inst.avatarPool.push(poolObject);
        }
},1000);
    });

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.