Skip to content

Turn off NSAsserts in release mode on iOS and macOS #157837

@jmagman

Description

@jmagman

In a typical iOS and macOS project NSAsserts are off in release mode. Here's the ENABLE_NS_ASSERTIONS build setting in a newly created project:

Screenshot 2024-10-29 at 9 30 11 PM

Controls whether assertion logic provided by NSAssert is included in the preprocessed source code or is elided during preprocessing. Disabling assertions can improve code performance.

flutter/buildroot#860 attempted to turn off asserts in release mode, however there were some analyzer errors when it was rolled into the engine, so the buildroot commit was reverted.

clang tidy:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8746478531016733745/+/u/test:_test:_lint_host_debug/stdout

Fix the analyzer errors, then reland flutter/buildroot#860 to turn off ENABLE_NS_ASSERTIONS in Release mode.

Examples of NSAssert crashes that probably shouldn't be happening in #148279

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.team-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions