App ran fine on React Native 0.35.0. After updating to 0.40.0 via react-native-git-upgrade
I get a number of lexical/preprocessor issues when trying to build/ru
I had the same issue. I have solved it by removing the Test target of my app from build scheme.
As pointed out by th0th, there is a breaking change in RN 0.40 for iOS. In short, RN header declarations are updated to point to the include path $(BUILT_PRODUCTS_DIR)/include/React
.
To solve the issue, you have to do the following:
Note: You might still have similar header issue with other libraries (e.g. react-native-fbsdk) that are referring to those react native .h files.
Here is how I made it work:
#import '....h'
that were causing error to the corresponding #import <React/.....h>
.If you use pod, maybe you can try this solution:
Go to Header Search Paths:
Pods -> TARGETS -> (YOUR TARGET, like my target is RNGL) -> Build Settings -> All -> Search Paths -> Header Search Paths
add a path:
"${PODS_ROOT}/Headers/Public/React"
non-recursive
If your app isn't to large, just
1) rename original app
2) create the same app again react-native init <orig_app_name>
3) copy over all necessary files from your original app to the newly created one
4) adjust the package.json
5) npm install
6) react-native run-<ios|android>
I spent hours to find, where to link the new libraries, it was at least a valuable option and shortcut for me.
hope it helps somebody
Update from
to
the clean and build.
Although, I have not tested it, I suspect if I made no changes and just clean and build it would have done the trick.