【Creator 3.8.6】iOS 真机疯狂无限报错输出: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [SE_ERROR] (/Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/bindings/jswrapper/v8/ScriptEngine.cpp, 1030): Invoking function failed, TypeError: Cannot read properties of null (reading ‘vertexCount’)

at $F.updateColor (src/cocos-js/cc.js:1:741712)

at t._updateColor (src/cocos-js/cc.js:1:618978)

at t._updateColor (src/cocos-js/cc.js:1:630875)

at set color [as color] (src/cocos-js/cc.js:1:616048)

at SF._resetLabelState (src/cocos-js/cc.js:1:7189

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/application/CocosApplication.cpp: line 173

10:40:14 [ERROR]:

Uncaught Exception:

  • location : src/cocos-js/cc.js:1:340476:

System.register([],(function(t,e){“use strict”;return{execute:function(){function i(t,e,i,s){i&&Object.defineProperty(t,e,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(s):void 0})}function s(t,e,i,s,n){var r={};return Object.keys(s).forEach((function(t){r[t]=s[t]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=i.slice().reverse().reduce((function(i,s){return s(t,e,i)||i}),r),n&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(n):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null),r}function n(t,e){const i=“undefined”==typeof window?global:window;return void 0===i[t]?i[t]=e:i[t]}t({BitMask:ce,CCClass:fi,Enum:pe,Eventify:No,WorldNode3DToLocalNodeUI:la,WorldNode3DToWorldNodeUI:ca,checkObsoleteInNamespace:function(t){return ht||(ht=“undefined”==typeof Proxy?{}:new Proxy(t,{get:(t,e,i)=>(at(e),Reflect.get(t,e,i))})),ht},checkObsolete:function(t){for(let e of t)at(e)},_resetDebugSetting:R,absMax:qi,absMaxComponent:$i,applyMixins:u,approx:Mi,assert:M,assertID:W,assertIsNonNullable:function(){},assertIsTrue:function(){},assertsArrayIndex:ue,bezier:Lc,bezierByTime:jc,binarySearch:function(t,e){return Ga(t,e,0)},binarySearchBy:function(t,e,i){let s=0,n=t.length-1,r=n>>>1;for(;s<=n;r=s+n>>>1){const o=t[r];if(i(o,e)<0)n=r-1;else{if(!(i(o,e)>0))return r;s=r+1}}return~s},binarySearchEpsilon:Ga,ccenum:ge,clamp:Pi,clamp01:Ri,color:Ns,computeRatioByType:sX,createDefaultPipeline:WK,debug:P,debugID:k,deprecateModuleExportedName:ot,deserialize:Hg,enumerableProps:Ki,equals:Oi,error:O,errorID:G,find:gw,flattenCodeArray:Yu,floatToHalf:Ji,formerlySerializedAs:Sh,fragmentText:JA,getBaselineOffset:PA,getEnglishWordPartAtFirst:QA,getEnglishWordPartAtLast:ZA,getError:Y,getPathFromRoot:function(t,e){let i=t,s="";for(;null!==i&&i!==e;)s=`{i.name}/{s}`,i=i.parent;return s.slice(0,-1)},getSerializationMetadata:function(t){return t[yh]},getSymbolAt:XA,getSymbolCodeAt:YA,getSymbolLength:WA,getWorldTransformUntilRoot:VV,halfToFloat:ts,instantiate:Dq,inverseLerp:Yi,isCCClassOrFastDefined:yi,isCCObject:Io,isDisplayStats:,isEnglishWordPartAtFirst:function(t){return VA.test(t)},isEnglishWordPartAtLast:function(t){return UA.test(t)},isUnicodeCJK:HA,isUnicodeSpace:GA,isValid:Do,lerp:Bi,loadWasmModuleBullet:function(){return Promise.resolve()},loadWasmModuleSpine:zct,log:I,logID:N,mat4:wn,murmurhash2_32_gc:Gu,nextPow2:ji,pingPong:Xi,pseudoRandom:Vi,pseudoRandomRange:Hi,pseudoRandomRangeInt:Gi,quat:ln,random:Ni,randomRange:ki,randomRangeInt:Ui,rect:jn,repeat:Wi,safeMeasureText:jA,sampleAnimationCurve:iX,setDefaultLogTimes:function(t){t>0&&(it=t)},setDisplayStats:q,setPropertyEnumType:si,setPropertyEnumTypeOnAttrs:ni,setRandGenerator:zi,shift:function(t,e,i){if(ue(t,e),ue(t,i),e===i)return t;const s=t[e];if(e<i)for(let s=e+1;s<=i;++s)t[s-1]=t[s];else for(let s=e;s!==i;–s)t[s]=t[s-1];return t[i]=s,t},size:Un,toDegree:Li,toRadian:Fi,tween:Kut,tweenUtil:Qut,v2:Nn,v3:Os,v4:ms,warn:D,warnID:V}),n(“CC_WECHAT”,!1),n(“CC_XIAOMI”,!1),n(“CC_ALIPAY”,!1),n(“CC_BYTEDANCE”,!1),n(“CC_OPPO”,!1),n(“CC_VIVO”,!1),n(“CC_HUAWEI”,!1),n(“CC_MIGU”,!1),n(“CC_HONOR”,!1),n(“CC_COCOS_RUNTIME”,!1);n(“CC_EDITOR”,!1),n(“CC_PREVIEW”,!1),n(“CC_BUILD”,!0),n(“CC_TEST”,!1),n(“CC_DEBUG”,!1),n(“CC_DEV”,!1),n(“CC_MINIGAME”,!1),n(“CC_RUNTIME_BASED”,!1),n(“CC_SUPPORT_JIT”,!0),n(“CC_JSB”,!0);const r=“undefined”==typeof window?global:window,o=t(“cclegacy”,{_global:r}),a=o;o.internal={};const h=t(“VERSION”,“3.8.6”);r.CocosEngine=a.ENGINE_VERSION=h,r.cc=a;const l=void 0!==globalThis.jsb&&void 0!==jsb.window?jsb.window:globalThis;r.ccwindow=l;const c=2147483647;function u(t){return(t>0)-(t<0)}function d(t,e){return t^(t^e)&-(t<e)}function p(t){let e,i;return e=(t>65535)<<4,i=((t>>>=e)>255)<<3,e|=i,i=((t>>>=i)>15)<<2,e|=i,i=((t>>>=i)>3)<<1,e|=i,e|(t>>>=i)>>1}function _(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>

10:40:14 [ERROR]: JS: src/cocos-js/cc.js:1:340476:

System.register([],(function(t,e){“use strict”;return{execute:function(){function i(t,e,i,s){i&&Object.defineProperty(t,e,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(s):void 0})}function s(t,e,i,s,n){var r={};return Object.keys(s).forEach((function(t){r[t]=s[t]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=i.slice().reverse().reduce((function(i,s){return s(t,e,i)||i}),r),n&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(n):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null),r}function n(t,e){const i=“undefined”==typeof window?global:window;return void 0===i[t]?i[t]=e:i[t]}t({BitMask:ce,CCClass:fi,Enum:pe,Eventify:No,WorldNode3DToLocalNodeUI:la,WorldNode3DToWorldNodeUI:ca,checkObsoleteInNamespace:function(t){return ht||(ht=“undefined”==typeof Proxy?{}:new Proxy(t,{get:(t,e,i)=>(at(e),Reflect.get(t,e,i))})),ht},checkObsolete:function(t){for(let e of t)at(e)},_resetDebugSetting:R,absMax:qi,absMaxComponent:$i,applyMixins:u,approx:Mi,assert:M,assertID:W,assertIsNonNullable:function(){},assertIsTrue:function(){},assertsArrayIndex:ue,bezier:Lc,bezierByTime:jc,binarySearch:function(t,e){return Ga(t,e,0)},binarySearchBy:function(t,e,i){let s=0,n=t.length-1,r=n>>>1;for(;s<=n;r=s+n>>>1){const o=t[r];if(i(o,e)<0)n=r-1;else{if(!(i(o,e)>0))return r;s=r+1}}return~s},binarySearchEpsilon:Ga,ccenum:ge,clamp:Pi,clamp01:Ri,color:Ns,computeRatioByType:sX,createDefaultPipeline:WK,debug:P,debugID:k,deprecateModuleExportedName:ot,deserialize:Hg,enumerableProps:Ki,equals:Oi,error:O,errorID:G,find:gw,flattenCodeArray:Yu,floatToHalf:Ji,formerlySerializedAs:Sh,fragmentText:JA,getBaselineOffset:PA,getEnglishWordPartAtFirst:QA,getEnglishWordPartAtLast:ZA,getError:Y,getPathFromRoot:function(t,e){let i=t,s="";for(;null!==i&&i!==e;)s=`{i.name}/{s}`,i=i.parent;return s.slice(0,-1)},getSerializationMetadata:function(t){return t[yh]},getSymbolAt:XA,getSymbolCodeAt:YA,getSymbolLength:WA,getWorldTransformUntilRoot:VV,halfToFloat:ts,instantiate:Dq,inverseLerp:Yi,isCCClassOrFastDefined:yi,isCCObject:Io,isDisplayStats:,isEnglishWordPartAtFirst:function(t){return VA.test(t)},isEnglishWordPartAtLast:function(t){return UA.test(t)},isUnicodeCJK:HA,isUnicodeSpace:GA,isValid:Do,lerp:Bi,loadWasmModuleBullet:function(){return Promise.resolve()},loadWasmModuleSpine:zct,log:I,logID:N,mat4:wn,murmurhash2_32_gc:Gu,nextPow2:ji,pingPong:Xi,pseudoRandom:Vi,pseudoRandomRange:Hi,pseudoRandomRangeInt:Gi,quat:ln,random:Ni,randomRange:ki,randomRangeInt:Ui,rect:jn,repeat:Wi,safeMeasureText:jA,sampleAnimationCurve:iX,setDefaultLogTimes:function(t){t>0&&(it=t)},setDisplayStats:q,setPropertyEnumType:si,setPropertyEnumTypeOnAttrs:ni,setRandGenerator:zi,shift:function(t,e,i){if(ue(t,e),ue(t,i),e===i)return t;const s=t[e];if(e<i)for(let s=e+1;s<=i;++s)t[s-1]=t[s];else for(let s=e;s!==i;–s)t[s]=t[s-1];return t[i]=s,t},size:Un,toDegree:Li,toRadian:Fi,tween:Kut,tweenUtil:Qut,v2:Nn,v3:Os,v4:ms,warn:D,warnID:V}),n(“CC_WECHAT”,!1),n(“CC_XIAOMI”,!1),n(“CC_ALIPAY”,!1),n(“CC_BYTEDANCE”,!1),n(“CC_OPPO”,!1),n(“CC_VIVO”,!1),n(“CC_HUAWEI”,!1),n(“CC_MIGU”,!1),n(“CC_HONOR”,!1),n(“CC_COCOS_RUNTIME”,!1);n(“CC_EDITOR”,!1),n(“CC_PREVIEW”,!1),n(“CC_BUILD”,!0),n(“CC_TEST”,!1),n(“CC_DEBUG”,!1),n(“CC_DEV”,!1),n(“CC_MINIGAME”,!1),n(“CC_RUNTIME_BASED”,!1),n(“CC_SUPPORT_JIT”,!0),n(“CC_JSB”,!0);const r=“undefined”==typeof window?global:window,o=t(“cclegacy”,{_global:r}),a=o;o.internal={};const h=t(“VERSION”,“3.8.6”);r.CocosEngine=a.ENGINE_VERSION=h,r.cc=a;const l=void 0!==globalThis.jsb&&void 0!==jsb.window?jsb.window:globalThis;r.ccwindow=l;const c=2147483647;function u(t){return(t>0)-(t<0)}function d(t,e){return t^(t^e)&-(t<e)}function p(t){let e,i;return e=(t>65535)<<4,i=((t>>>=e)>255)<<3,e|=i,i=((t>>>=i)>15)<<2,e|=i,i=((t>>>=i)>3)<<1,e|=i,e|(t>>>=i)>>1}function _(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135

10:40:14 [ERROR]: [SE_ERROR] (/Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/bindings/jswrapper/v8/Object.cpp, 774): Invoking function (0x282233a30) failed!

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.

10:40:14 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.6/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 904

10:40:14 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 12 is not bounded.


后面还在无限输出,我就不copy了,这是啥问题啊?

补充说一下:游戏并不是一进来就报错,是玩着玩着,突然开始疯狂报错了,然后界面卡死。

还没定位到具体原因,但是大量 文本框的缓存模式: Char 字符模式真有点不敢用了,太可怕了。

去掉 Label 和 RichText中缓存模式为: Char 的设置,改为 None,这个bug就没有了。但是由于文本大量,不使用 Char 后,游戏巨卡无比,没办法了,蛋疼。

CHAR 模式有图集的数量限制的

https://docs.cocos.com/creator/3.8/manual/zh/ui-system/components/editor/label.html#文本缓存类型-cache-mode

猜测你里面的文本应该比较多不重复的,导致超过图集的限制导致的报错。

https://forum.cocos.org/t/topic/167619?u=1299561671 我开启了ASTC纹理压缩后, 3.8.6 到iOS真机也是疯狂报错

应该没超过图集限制,虽然我的文本量大,但只有26个字母加上大小写,和一些标点符号,26+26 不超过70个字符吧。而且字号很小,不可能超过1024*1024,只不过会频繁的修改文本,因为我放在 ScrollView 中,每次滚动会频繁修改文本,所以我认为不是图集限制的这个bug,是引擎内部这个 Char 模式的bug。

3.8.6 版本之前, Char模式会在编辑器控制台提示一个报错信息,具体什么信息我忘了,我之前在论坛搜过好像很久很久一直都没修复,3.8.6 这个版本缺失修复了这个问题,但是我怀疑和那个bug有关,引擎团队只是让那个报错红色不显示了,但是并没有彻底的解决这个 Char 模式的bug。

有修改字号或者颜色什么的吗?这些信息的变化也会导致无法复用原有的字,重新加到图集里的,也可以把字体图集渲染出来看下是否满了

我和你一样,iOS开启astc报错

既然都是英文字母,那为什么不用位图文字呢…