react-native
react-native copied to clipboard
HEADER_SEARCH_PATHS concatenation issue
New Version
0.72.6
Old Version
0.70.5
Build Target(s)
iOS simulator
Output of react-native info
System: OS: macOS 14.1.1 CPU: (10) arm64 Apple M1 Pro Memory: 812.52 MB / 32.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 16.14.0 path: ~/.nvm/versions/node/v16.14.0/bin/node Yarn: version: 1.22.21 path: ../node_modules/.bin/yarn npm: version: 8.3.1 path: ~/.nvm/versions/node/v16.14.0/bin/npm Watchman: Not Found Managers: CocoaPods: version: 1.14.3 path: /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 23.0 - iOS 17.0 - macOS 14.0 - tvOS 17.0 - watchOS 10.0 Android SDK: API Levels: - "26" - "28" - "29" - "30" - "31" - "32" - "33" - "34" - "34" Build Tools: - 28.0.3 - 29.0.2 - 30.0.2 - 30.0.3 - 31.0.0 - 32.0.0 - 32.1.0 - 33.0.0 - 34.0.0 System Images: - android-30 | Intel x86_64 Atom - android-30 | Google APIs Intel x86 Atom - android-32 | Google APIs ARM 64 v8a - android-32 | Google Play ARM 64 v8a - android-33 | Google APIs ARM 64 v8a - android-33 | Google Play ARM 64 v8a - android-34 | Google Play ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2022.3 AI-223.8836.35.2231.11090377 Xcode: version: 15.0.1/15A507 path: /usr/bin/xcodebuild Languages: Java: version: 11.0.21 path: ../.jenv/shims/javac Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.6 wanted: 0.72.6 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false
Issue and Reproduction Steps
After upgrading to the new version, we also upgraded our RNFirebase
module which requires Cocoapods to use framework.
As a result of these changes, whenever I run pod install
, I see new changes in my Xcode HEADER_SEARCH_PATHS.
It seems that you are concatenating the search paths with the previous ones. Probably in this script.
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
Hi @hamidhadi, thanks for the report. I'll look into it. What is the pod that is getting multiple HEADER_SEARCH_PATHS?
The link you added refers to a function called get_react_codegen_spec
that we use internally to create the React-Codegen
podspec on the flight.
So it is regenerated at every pod install, and therefore the search_path
should not concatenate. I suspect for the issue to happen in some other podspec.
PSA: I'll be on PTO from tomorrow until the 12th of December.
I'm experiencing the same issue (most probably after updating to React Native 0.73.0, but we've also bumped other dependencies).
HEADER_SEARCH_PATHS = (
"$(inherited)",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
+ " ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
+ " ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
+ " ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
);
This concatenation happens in every configuration (Debug
, Release
) after running pod install
.
It seems that after removing the Pods_Kaartje2go.framework
build phase (under Link Binary With Libraries), this concatenation does not happen.
@annuh Could you share on which target it is happening? Could any of you prepare a repro using https://github.com/react-native-community/reproducer-react-native? Otherwise it is really hard for me to help you out, because I am not able to reproduce this behavior locally.
@cipolleschi I've created a reproducer here: https://github.com/annuh/reproducer-react-native.
I believe it's related to an old/correct installation of RN Firebase, since I fixed the issue by reinstalling the Firebase library.
The HEADER_SEARCH_PATHS
in my original ./ios/AwesomeProject.xcodeproj/project.pbxproj
contained this:
HEADER_SEARCH_PATHS = (
"$(inherited)",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
);
This happened after a pod install
:
HEADER_SEARCH_PATHS = (
"$(inherited)",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
+ " ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
+ " ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
+ " ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
);
However, when I reinstalled RN Firebase completely in a new project, the HEADER_SEARCH_PATHS
contained this:
HEADER_SEARCH_PATHS = (
"$(inherited)",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", #
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", #
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", #
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
So a pod install
added all the 'missing'(?) folders, which is probably correct 🙂
The problem is that it adds these lines with a trailing
(whitespace), so these folders are added after every pod install
.
I experience the concatenation since upgrading to react-native 0.73.2. After every pod install the following lines are added to my project:
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
Are these repeated multiple times? Because it is expected for you to have these 3 new lines.
If they are repeated, try to run:
bundle exec pod deintegrate
to cleanup the Pod structure and then rerun:
bundle eexec pod install
to reinstall it.
Yes there are repeated.
It seems that pod deintegrate
fixed it! Thanks!
Had the same issue after updating react-native
from v0.72.6 to v.073.2. The only thing that prevented subsequent install pods steps from adding the same 3 lines again was to manually edit the project.pbxproj
file and remove the empty spaces added at the beginning of each of the 3 lines.
Despite upgrading react-native-firebase
as per @annuh’s suggestion, I still encountered the issue of duplicated concatenation and white space prefix at HEADER_SEARCH_PATHS.
My current workaround:
- [ ] Run
pod deintegrate
to resolve duplicated concatenation issue. - [ ] Then remove white space prefix at HEADER_SEARCH_PATHS
I noticed that these lines start with spaces. I removed spaces and it helped. 🎉
Removing the spaces is definitely going to fix it, it is better though to replace the HEADER_SEARCH_PATHS
with
HEADER_SEARCH_PATHS = (
"$(inherited)",
);
then run pod install
in the ios
directory, this will generate the correct paths again, for some reason pod deintegrate
doesn't do this
I'm guessing that maybe this commits to make this behaviour happens: https://github.com/facebook/react-native/commit/fa6f170658723acffcac0102386c8efcd37f121e#diff-2bd8393b331d124e068c72072334b0d49cc9aea43828f768b36c5dc25576b4c7
I'm using use_frameworks! :linkage => :static
for my build target in my Podfile, and I checked the added lines in my pbxproj
file after run pod install
and find out this is the most possible commit to make the HEADER_SEARCH_PATHS
concatenated.
In line 281, the script will generate the header search paths then use self.add_search_path_if_not_included
to concat our HEADER_SEARCH_PATHS
, and in the definition of self.add_search_path_if_not_included
in utils.rb
, I see it will add a whitespace prefix if the search path not included.
As the function to check the search path without the whitespace prefix, so the checking will be always true in this case, this will let the script will add the 'not exists' search path into our pbxproj
file each pod install
run time.