fix: iOS build error on React Native v0.81#19
Conversation
|
FYI, I'm worried that this is not backwards-compatible :/ I tried adding those changes to the project with RN |
|
I'll look into this in a bit and see if we can make this backwards-compatible. Thanks already! |
|
Thanks for your PR @war-in !
The broken example project build was addressed in #21 and #22
I just made your changes backwards-compatible. I'll create a PR with the new |
|
@chrispader That's great! Thank you! Please tag me under the E/App PR once it's ready 🙏 |
|
Just tested this PR on both RN0.72 and RN0.81 and it builds fine! |
|
Thanks for the fix @chrispader. However, this still fails on our app (after migration to Expo 54). Maybe relevant parts of my package.json: I examined your fix in more detail (first lines of Here, the Where is that |
|
Seems the reason for my problem is using Expo SDK 54, which uses precompiled XCFrameworks for iOS to speed up build times. However, this means that certain header files like A quick fix for this might be to add the following to your This disables the precompiled XCFrameworks. However, when trying that out, I still ran into the same errors. Any idea? Has anyone managed to get 0.4.1 running with Expo 54? |
hmm interesting, I didn't know that these headers are stripped out when using precompiled frameworks in Expo. I'll think of a fix for this in Expo. It's just that this is now the best approach on getting the RN version at build time using macros. |
@yolpsoftware this is the file I'm referencing: https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/cxxreact/ReactNativeVersion.h |
|
@chrispader @yolpsoftware With Expo 54 I am able to get this to compile by including the header directly from #if __has_include(<cxxreact/ReactNativeVersion.h>)
#include <cxxreact/ReactNativeVersion.h> |
|
@thejustinwalsh thank you, but that does not work for me either. I installed the current 0.4.1 version, then went into Still getting Also tried (since the |
|
Moving discussion to #20 as this issue is merged. |
While migrating Expensify/App to the newest React Native version (v0.81), I got a build issue where
react-native-release-profilercouldn't findenableSamplingProfilerIt turned out that we should use the new approach (
IHermesRootAPI) to access the functionsIHermesRootAPI *api = castInterface<IHermesRootAPI>(makeHermesRootAPI()); api->enableSamplingProfiler();Unfortunately, I wasn't able to build the example app due to some issues with pods (I followed the CONTRIBUTING.md file), so I'd appreciate some help 🙏
cc @chrispader as you're actively working on the Expensify/App