[v2] fix: set NDEBUG=1
preprocessor flag in release mode
#2270
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
NDEBUG
flag 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=1
when runningpod install
(so thatRNReanimated.podspec
knows that it should injectNDEBUG
flag) but this flag is not well-documented so many people don't know about it.Changes
NDEBUG=1
flag toGCC_PREPROCESSOR_DEFINITIONS
forRelease
variant inVisionCamera.podspec
Tested 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.