How to fix warning “CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: '(null)'”?

依然范特西╮ 提交于 2020-01-02 02:43:10

问题


I try to test app on iOS13 beta. When I tap button on welcome screen to segue to another screen app freezes and then terminates. When I debug in Xcode 11 i see following warning lines in console log

[framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: '(null)'
[framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: '(null)'

and then after several seconds app terminates with log entry:

Message from debugger: Terminated due to memory issue

on iOS 12 there is no such problem. I created simple test app with several assets files and segue on button tap worked fine. Also I changed target version to iOS 13, changed bundle identifier, make clean and rebuild - but problem doesn't vanish


回答1:


I found out that problem was not related to

"CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: '(null)'"

On target screen was used custom UILabel. The root cause of app freezing and memory issue was reentrant looping between it's methods

override var text: String? {
    didSet {
        guard let text = text else { return }
        let textRange = NSMakeRange(0, text.count)
        // Kern attribute needed to do letter spacing over text
        let attributedText = NSMutableAttributedString(string: text)
        attributedText.addAttribute(NSAttributedStringKey.kern , value: 2.0, range: textRange)
        // Add other attributes if needed
        self.attributedText = attributedText
    }
}

and

override public func layoutSubviews() {
    super.layoutSubviews()
    if let text = self.text {
        self.text = text.uppercased()
    }
}

probably new SDK version invokes layoutSubviews() when attributedText field has changed




回答2:


To fix this issue, just to target's build phase and then remove Assets.xcasset and re-add it



来源:https://stackoverflow.com/questions/57912288/how-to-fix-warning-coreui-runtimethemerefforbundleidentifierandname-couldnt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!