Xcode 14: [Assert] UINavigationBar decoded as unlocked for UINavigationController

In Xcode 14 RC, I'm seeing this in the Console:

[Assert] UINavigationBar decoded as unlocked for UINavigationController, or navigationBar delegate set up incorrectly. Inconsistent configuration may cause problems. navigationController=<MasterNavigationController: 0x135016200>, navigationBar=<UINavigationBar: 0x134f0aec0; frame = (0 20; 0 50); opaque = NO; autoresize = W; layer = <CALayer: 0x600000380be0>> delegate=0x135016200

The above message displays exactly four times immediately at app launch (top of the console) then does not repeat.

MasterNavigationController is the internal class for the app's navigation controller. It is in a Storyboard, with very minimal ObjC code. I am not setting any specific size for the nav bar.

I don't remember seeing this in earlier builds of Xcode, but I can't swear to it that this is new. No assertion actually fires.

Same! I only added NavigationBar, almost no code in the project, but this error displays.

[Assert] UINavigationBar decoded as unlocked for UINavigationController, or navigationBar delegate set up incorrectly. Inconsistent configuration may cause problems. navigationController=<UINavigationController: 0x109822e00>, navigationBar=<UINavigationBar: 0x108b2aef0; frame = (0 44; 0 50); opaque = NO; autoresize = W; layer = <CALayer: 0x280d5f2e0>> delegate=0x109822e00

Same issue we also facing... in OS 16 after splash screen showing black screen only.

After setting rootViewController call makeKeyAndVisible. This work for me.

self.window?.rootViewController = navigationVC self.window?.makeKeyAndVisible()

Calling makeKeyAndVisible does nothing in my apps to silence this. There must be another reason for it.

Could it be apps where the interface files were created a long time ago?

same...I faced this error after ios 16 upgrade. Under iOS 15, It does not showing.

+1

Interface builder files were created a LONG time ago. Never had an issue with iOS 12, 13, 14, or 15.

This happens in a brand new project. I created a basic iOS app. In the storyboard, added a navigation bar controller, set that as the initial view controller, and set its root to the original view controller. Log is spammed once with that warning. Seems Apple needs to clean something up; especially if newly created projects will exhibit the same issue.

I just reported this.....iOS has so many alarmist system logs now devs have no way of controlling.

Also filed: "FB11508814" with attached minimal sample project.

Interesting. Apple's system here is auto-generating a hyperlink for the Feedback identifier. Yet it is excluding the last digit in the link. Guess I'll file another bug. Putting the identifier in quotes was an experiement to see if the link would get fixed.

This is only an iOS 16 issue because when I run the app on my iPhone with iOS 15.6 these warnings don't show up.

Bug also exists in Xcode 14.1 Beta

Also in Xcode 14 final release.

Same...I faced this error after ios 16 upgrade, and only displays on iOS16 device. The error only displays if I create UINavigationController in storyboard. In my source, I create a UITabBarController with 4 tabs(UINavigationController) in storyboard, so the message displays 4 times. Then I changed to create UINavigationController in code, the error dose not showing.

I just know using the storyboard. What is it like with code?

I get this error along with navigationItem.leftBarButtonItem & navigationItem.rightBarButtonItem (using UIBarButtonItem, both system or custom) not appearing in the UI on iOS16, but works perfectly in versions prior to iOS 16.

In iOS16, when I view Debug View Hierarchy, these elements seem to be completely missing.

On the left of the navigation bar:- UINavigationBar > _UINavigationBarContentView >> _UIButtonBarStackView = No Content On the right of navigation bar: UINavigationBar > _UINavigationBarContentView >> _UIButtonBarStackView = No content

One with warning “Width and horizontal position are ambiguous” (Left)

But in iOS15.5, we see the correct content in view and reported correctly in Debug View Hierarchy

UINavigationBar > _UINavigationBarContentView > _UIButtonBarStackView = Has content, i.e. custom UIVVIew > UILabel

We're using Storyboards too.

Even when creating a new UINavigationBar() directly in the associated viewController, I get the same behaviour in iOS16 with navigationItem.leftBarButtonItem & navigationItem.rightBarButtonItem not rendering to screen or visibile in Debug View Hierarachy.

However, when using navigationController?.popToViewController(self, animated: false), the back button to the previous view renders fine and navigation bar titles work fine in iOS16, it's just navigationItem bar buttons that are not displaying.

Same here, I didn't even touched navigationBar...

Having the same issue. My project has been created a long time ago using Storyboards (2018).

App has been updated in 2020 and so far was running fine until iOS 16 (no errors in iOS 15 or lower).

I am getting this error in the console but I don't see any visual issues:

2022-09-22 09:41:01.111985-0400 [Assert] UINavigationBar decoded as unlocked for UINavigationController, or navigationBar delegate set up incorrectly. Inconsistent configuration may cause problems. navigationController=<UINavigationController: 0x7fdf92826600>, navigationBar=<UINavigationBar: 0x7fdf9070b720; frame = (0 0; 0 50); autoresize = W; tintColor = UIExtendedGrayColorSpace 1 1; layer = <CALayer: 0x6000010907e0>> delegate=0x7fdf92826600

I also have a crash happening randomly which might be related (only under iOS 16 as well): libsystem_platform.dylib`os_unfair_lock_lock

I have added the fix for the default transparent navigationBar under iOs 15+ which worked but did not get rid of the assert error:

 //Fix Nav Bar tint issue in iOS 15.0 or later - is transparent w/o code below
  if (@available(iOS 15, *)) {
    UINavigationBarAppearance *navBarAppearance = [[UINavigationBarAppearance alloc] init];
    [navBarAppearance configureWithDefaultBackground];
    navBarAppearance.backgroundColor = [UIColor colorWithRed: 0.05 green: 0.09 blue: 0.20 alpha: 1.00];
    [UINavigationBar appearance].standardAppearance = navBarAppearance;
    [UINavigationBar appearance].compactAppearance = navBarAppearance;
    [UINavigationBar appearance].scrollEdgeAppearance = navBarAppearance;
  }

I was able to solve it by setting storyboard's build target. Open the storyboard and select the File Inspector tab. Set the "Builds For" value to your deployment target.

It will fix the error.

I was able to solve it by setting storyboard's build target. Open the storyboard and select the File Inspector tab. Set the "Builds For" value to your deployment target.

For me it is already set to correct value. Even when I set it to different version and then back to Deployment Target version, the error in console stays.

I'm also facing this issue in a brand new iOS project in Xcode 14 (14A309) with a minimum deployment target of iOS 16.

I tried changing the Lock setting from the Identity Inspector's Document section for both the navigation controller and its navigation bar. I also tried manually assigning an empty delegate to my view controller's navigationController?.navigationBar property, but all of these attempts did not resolve this assertion message.

I'm assuming it is simply an oversight; one of those harmful internal logs that should be hidden, but left visible by mistake, as it doesn't seem to cause any visual issues for me when using the default navigation controller scene in the storyboard.

I hope it will be fixed or silenced in Xcode 14.1

I also have this Assert in the log. I also have a problem with the view that I am troubleshooting. I guess we just ignore it for now?

You are all misinterpreting this log message. I have found it to be a daily source of inspiration.

@nirav78 storyboard was set to the same value as deployment target (and minimum deployment) ; and I get the error in iOS 16, Xcode 14.0

I just upgraded to Xcode Version 14.0.1 (14A400) last week, and now I too am seeing this error message. Whats also frustrating is when copying and pasting the error message into the search bar on the main page of these forums, no threads are found. I paste the exact same text into Google and this thread is first on the list. I'm assuming many of you found your way here as a result of a Google search as well.

Well, either way, glad to see I'm not the only one encountering this. My project is a very basic "sample app" for developers using our Framework, setup entirely in a Storyboard with a handful of scenes.

I did double check the Deployment Target as mentioned above, this was already properly set.

Xcode 14: [Assert] UINavigationBar decoded as unlocked for UINavigationController
 
 
Q