[v2] fix: set NDEBUG=1 preprocessor flag in release mode#2270
Merged
mrousavy merged 1 commit intomrousavy:v2from Dec 11, 2023
Merged
[v2] fix: set NDEBUG=1 preprocessor flag in release mode#2270mrousavy merged 1 commit intomrousavy:v2from
NDEBUG=1 preprocessor flag in release mode#2270mrousavy merged 1 commit intomrousavy:v2from
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
5 tasks
NDEBUG=1 preprocessor flag in release modeNDEBUG=1 preprocessor flag in release mode
NDEBUG=1 preprocessor flag in release modeNDEBUG=1 preprocessor flag in release mode
Owner
|
You're the 🐐! LGTM thanks Tomasz! ❤️ |
Contributor
Author
|
@mrousavy Thanks for merging this PR! Would it be possible to publish a new v2 release with this fix? |
Owner
|
Sorry, went for lunch & forgot haha - just released 2.16.5! :) thanks again! |
Contributor
Author
|
Thank you on behalf of the entire community! |
j-piasecki
pushed a commit
to j-piasecki/react-native-vision-camera
that referenced
this pull request
Feb 12, 2024
…2270) Set `NDEBUG=1` preprocessor flag in release mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR fixes the following error reported in #2265 that occurs when trying to build a RN app with Reanimated 3.6.x and RNVisionCamera 2.16.5 with Frame Processors enabled in release mode on iOS on Paper:
The root cause of this issue is that Reanimated 3.6.0 uses a well-known
NDEBUGflag but unfortunately React Native does not set it on iOS on Paper (it is set correctly on Fabric, though). The workaround is to set environmental variablePRODUCTION=1when runningpod install(so thatRNReanimated.podspecknows that it should injectNDEBUGflag) but this flag is not well-documented so many people don't know about it.Changes
NDEBUG=1flag toGCC_PREPROCESSOR_DEFINITIONSforReleasevariant inVisionCamera.podspecTested on
I reproduced the error on a fresh RN 0.72.7 app with Reanimated 3.6.0 and RNVisionCamera 2.16.5 on iOS in release mode. Then I made the change in VisionCamera's podspec and the error was gone.
Related issues
Fixes #2265.
See software-mansion/react-native-reanimated#5366 for full explanation.