react-native-config: Build input file cannot be found with Xcode 14
I was able to build different environments using Xcode 13, but after updating to Xcode 14, I got this error:
error build: Build input file cannot be found: '/Users/user/Library/Developer/Xcode/DerivedData/.../Build/Products/GeneratedInfoPlistDotEnv.h'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
Any ideas? Thanks in advance!!
Xcode version: 14.0
react-native: 0.67.4
react-native-config: 1.4.6
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 22
- Comments: 22
For me, in ios/<app>.xcodeproj/project.pbxproj,
EXCLUDED_ARCHS = arm64 ;
which I removed, then started workingMy workaround is back to Xcode 13, hope it helps your case @albat
We were able to work around this issue. In our case, because the
.podspec
file doesn’t list$BUILD_DIR/GeneratedInfoPlistDotEnv.h
as anoutput_file
in its[CP-User] Config codegen
Run Script phase, Xcode was not buildingreact-native-config
early enough. This caused our app target to fail because the header file had not been generated yet. Adding anoutput_files
entry to the.podspec
fixes this issue.Here is a patch if you’re using
patch-package
:$ cat patches/react-native-config+1.4.6.patch
We also had updated from a previous version of
react-native-config
which was generating the header file in a different location. As a result, we also had to update our Info.plist Preprocessor Prefix File build setting to point to the new location$(BUILD_DIR)/GeneratedInfoPlistDotEnv.h
Working in
1.4.11
versionI found my own solution (using an old version of React Native):
Added this to the “Bundle React Native Code And Images” phase (which contains the script
node_modules/react-native/scripts/react-native-xcode.sh
:work for me too,
Worked for me!!!
i have same issue.
i change
Switching the scheme works for me
After spending hours of debugging, I ended up downgrading to the Xcode 13. It was the only solution for me as of now. When I compared the file changes since the last time the build was successfully archived, I observed that there were some code changes made by the Xcode 14(when I ran the build in it) in the file
ios/<project_name>.xcodeproj/project.pbxproj
something like:and
There were a couple more related to
ReactNativeConfig.xcodeproj
.I reverted those, downgraded to Xcode 13, deleted
Derived Data
, tried archiving again and this time, it was successful.1 more thing, I recently switched to the M2 Mac from Intel-Based Mac(last successful Archive was on Intel-Based Mac). I am not sure if that has anything to do with this issue.
I hope it will be helpful for someone.