Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am trying to test app on the iOS 13 beta. When I tap a button on my welcome screen to segue to another screen the app freezes and then terminates. When I debug in Xcode 11 I see following warning lines in the console:

[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 a simple test app with several assets files and the segue on the button tap worked fine. Also I changed the target version to iOS 13, changed the bundle identifier, cleaned and rebuilt, but the problem still occurs.

like image 933
Gomer Grek Avatar asked Sep 12 '19 18:09

Gomer Grek


Video Answer


1 Answers

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 its 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

like image 180
Gomer Grek Avatar answered Sep 19 '22 16:09

Gomer Grek