Open CuongNguyenV opened 2 years ago
Same issue on my side, project is working fine on XCode 13 and get the same error with XCode 14. Tried to upgrade to 1.4.7 but doesn't changed anything. Also tried to build with legacy build settings, doesn't helped neither :/
Same issue on my side, project is working fine on XCode 13 and get the same error with XCode 14. Tried to upgrade to 1.4.7 but doesn't changed anything. Also tried to build with legacy build settings, doesn't helped neither :/
My workaround is back to Xcode 13, hope it helps your case @albat
Same problem here, any idea how to solve it?
Facing the same issue. Any solutions yet guys? Thanks
I am facing the same issues too. I really don’t want to revert back to XCode 13
We were able to work around this issue. In our case, because the .podspec
file doesn't list $BUILD_DIR/GeneratedInfoPlistDotEnv.h
as an output_file
in its [CP-User] Config codegen
Run Script phase, Xcode was not building react-native-config
early enough. This caused our app target to fail because the header file had not been generated yet. Adding an output_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
diff --git a/node_modules/react-native-config/react-native-config.podspec b/node_modules/react-native-config/react-native-config.podspec
index 54985dd..854bfe7 100644
--- a/node_modules/react-native-config/react-native-config.podspec
+++ b/node_modules/react-native-config/react-native-config.podspec
@@ -25,7 +25,8 @@ HOST_PATH="$SRCROOT/../.."
"${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig/BuildDotenvConfig.rb" "$HOST_PATH" "${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig"
),
execution_position: :before_compile,
- input_files: ['$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/BuildDotenvConfig.rb']
+ input_files: ['$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/BuildDotenvConfig.rb'],
+ output_files: ['$BUILD_DIR/GeneratedInfoPlistDotEnv.h']
}
s.requires_arc = true
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
From my case, since we din't use the feature of Availability in Build settings and Info.plist
, we just removed the INFOPLIST_PREFIX_HEADER
and it works, just like this solution
@derrh Update: Thank you so much. It works. However, I cannot get the the variable from env in XCode any more :'(.
I have applied the patch recommended by @derrh but it does not resolve this issue for me.
Xcode version: 14.0
react-native: 0.68.2
react-native-config: 1.4.6
Experienced the issue today but didn't really do anything other than try to Archive again and it went away.
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:
/* ReactNativeConfig.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeConfig.xcodeproj; path = "../node_modules/react-native-config/ios/ReactNativeConfig.xcodeproj"; sourceTree = "<group>"; };
and
/* libReactNativeConfig.a in Frameworks */,
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.
For me, in ios/
EXCLUDED_ARCHS = arm64 ;
which I removed, then started working
Working in 1.4.11
version
Switching the scheme works for me
Switching the scheme works for me
Thank you, sir! When I explicitly set --scheme NAME
flag, build is succeed
I 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
:
outputPaths = (
"${BUILD_DIR}/GeneratedInfoPlistDotEnv.h"
);
Same problem what should i do for it . please help..
Thanks is advance.
Intel based Mac here, XCode 14 MacOS Ventura. The issue happened to me when switching branches. Apparently there is an issue if you create new files / groups (aka folders) or you move a file from one group to another, and then you change branches to another one where the folder has not been created.
I fixed it by deleting the Derived Data
folder, and cleaning the build folder.
Hope that helps fix the issue or at least determine why it happens to you 🙏
i have same issue.
Build input file cannot be found: '/Users/inkcrazy/Library/Developer/Xcode/DerivedData/Daling-arvboeyqyunjixcoavidvtbyfrru/Build/Intermediates.noindex/ArchiveIntermediates/Daling/InstallationBuildProductsLocation/Applications/Daling.app/Daling'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
i change
-"EXCLUDED_ARCHS[sdk=*]" = arm64;
+"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
I 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
:outputPaths = ( "${BUILD_DIR}/GeneratedInfoPlistDotEnv.h" );
Worked for me!!!!
I 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
:outputPaths = ( "${BUILD_DIR}/GeneratedInfoPlistDotEnv.h" );
work for me too,
I found solution for this.
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
diff --git a/node_modules/react-native-config/react-native-config.podspec b/node_modules/react-native-config/react-native-config.podspec index 54985dd..854bfe7 100644 --- a/node_modules/react-native-config/react-native-config.podspec +++ b/node_modules/react-native-config/react-native-config.podspec @@ -25,7 +25,8 @@ HOST_PATH="$SRCROOT/../.." "${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig/BuildDotenvConfig.rb" "$HOST_PATH" "${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig" ), execution_position: :before_compile, - input_files: ['$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/BuildDotenvConfig.rb'] + input_files: ['$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/BuildDotenvConfig.rb'], + output_files: ['$BUILD_DIR/GeneratedInfoPlistDotEnv.h'] } s.requires_arc = true
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
can't understand what should i do... i still get the same err
pod install
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!!