TextMeshPro 产生新字报错 NullReferenceException: Object reference not set to an instance of an object

您好!
请问使用 TextMeshPro 后在 IPhone 上产生新字体时报会错是什么问题?

建制环境:
Unity 2019.4
TextMeshPro 2.1.1

字体配置:
FONTSET.PNG


建制版本: Android (apk) 、IPhone (ipa)

运行环境:
安卓模拟器  Nox 7.0.1.0   : 正常  (除了不能置灰等本身存在问题以外,功能运行正常)
IPhone 7 plus、 IPhone 8  :  只要第一次遇到没使用过的字就会报空值错误,再次使用才恢复正常

重现方法:
开启包含文本框页面,文本框已于编辑器预先键入 "你好,世界!"

对文本框 SetText "你好,世界!真好!" ( 第一次被使用)
后台报错:NullReferenceException: Object reference not set to an instance of an object

文本框内文字被清空

再次对文本框 SetText "你好,世界! 真好!"
正确显示 "你好,世界! 真好!"
 
若有复数个文字第一次被产生,SetText 时会不断报错,得重复 SetText 直到所有文字被产生过才能正确显示

请问这是什么问题?
已邀请:

谷主

赞同来自:

报错你得说哪一行报错啊

mico

赞同来自:

更新:
运行时报错没trace到行数,用 Mac 能看出错误的历程

Screenshot_2021-12-08_9.02_.51_pm_.png

 
@谷主 有看出这是什么问题么?

mico

赞同来自:

抱歉给谷主添麻烦了,最后发现是IOS建制工程的TextMeshPro有问题,全部 Reimport 后重新建置已经可以正常运行了,谢谢回复

mico

赞同来自:

突然这问题跑到编辑器上了
编辑器版本 社区版 2021.3.1
不影响使用,但不知道怎么出现的
 (一直刷,重开就不见了)
 
ERROR.PNG

 
NullReferenceException: Object reference not set to an instance of an object.
at FairyGUI.ExternalTMPFont.GetGlyph (System.Char ch, System.Single& width, System.Single& height, System.Single& baseline) [0x00000] in <00000000000000000000000000000000>:0
at FairyGUI.TextField.BuildLines2 () [0x00000] in <00000000000000000000000000000000>:0
at FairyGUI.TextField.BuildLines () [0x00000] in <00000000000000000000000000000000>:0
at FairyGUI.TextField.get_htmlElements () [0x00000] in <00000000000000000000000000000000>:0
at FairyGUI.RichTextField.Dispose () [0x00000] in <00000000000000000000000000000000>:0
at FairyGUI.Container.Dispose () [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FObject.Dispose () [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FComponent.HandleDispose () [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FObject.Dispose () [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FComponent.HandleDispose () [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FObject.Dispose () [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FComponent.RemoveChildAt (System.Int32 index, System.Boolean dispose) [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FComponent.RemoveChildren (System.Int32 beginIndex, System.Int32 endIndex, System.Boolean dispose) [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FList.BuildItems () [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FList.ValidateChildren (System.Boolean checkOnly) [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FComponent.ValidateChildren (System.Boolean checkOnly) [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FComponent.ValidateChildren (System.Boolean checkOnly) [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FComponent.ValidateChildren (System.Boolean checkOnly) [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.FComponent.ValidateChildren (System.Boolean checkOnly) [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.View.Document.ValidateContent () [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.View.Document.OnValidate () [0x00000] in <00000000000000000000000000000000>:0
at System.Console+InternalCancelHandler.Invoke () [0x00000] in <00000000000000000000000000000000>:0
at FairyEditor.App.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0
at System.Console+InternalCancelHandler.Invoke () [0x00000] in <00000000000000000000000000000000>:0
at FairyGUI.Stage.InternalUpdate () [0x00000] in <00000000000000000000000000000000>:0
at FairyGUI.StageEngine.LateUpdate () [0x00000] in <00000000000000000000000000000000>:0

(Filename: currently not available on il2cpp Line: -1)

要回复问题请先登录注册