React native entry file breaking iOS archive command on Xcode
See original GitHub issueTrying to archive(Product->Archive
) a version locally on Xcode, the command is breaking returning an entry file issue.
Current Behavior
Expected Behavior
Get the app properly archived from Xcode.
Steps to Reproduce
- Create a fresh react native app using the nrwl boilerplate(
npx create-nx-workspace freshRnNxAppiOS --preset=react-native --appName=mobileiOS
). - Runs the
npx nx run mobilei-os:run-ios
command - Open Xcode and select the proper target to archive:
- On Product->Archive execute the command and wait for the reported error.
Failure Logs
/Users/davi.santos/Documents/fresh-rn-nx-appi-os/apps/mobilei-os/ios/Pods/../.xcode.env: line 12: PROJECT_DIR: command not found
../node_modules/react-native/scripts/xcode/with-environment.sh: line 35: .xcode.env: command not found
../node_modules/react-native/scripts/xcode/with-environment.sh: line 35: node: command not found
[Warning] You need to configure your node path in the environment. You can set it up quickly by running: echo 'export NODE_BINARY=' > .xcode.env in the ios folder. This is needed by React Native to work correctly. We fallback to the DEPRECATED behavior of finding . This will be REMOVED in a future version. You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment
Now using node v18.7.0 (npm v8.15.0)
+ DEST=/Users/davi.santos/Library/Developer/Xcode/DerivedData/MobileiOs-amarjsyrkayffpgjcigiiwampfzi/Build/Intermediates.noindex/ArchiveIntermediates/MobileiOs/BuildProductsPath/Release-iphoneos/MobileiOs.app
+ [[ Release = *Debug* ]]
+ [[ -n '' ]]
+ case "$CONFIGURATION" in
+ DEV=false
+++ dirname ../node_modules/react-native/scripts/react-native-xcode.sh
++ cd ../node_modules/react-native/scripts/..
++ pwd
+ REACT_NATIVE_DIR=/Users/davi.santos/Documents/fresh-rn-nx-appi-os/apps/mobilei-os/node_modules/react-native
+ PROJECT_ROOT=/Users/davi.santos/Documents/fresh-rn-nx-appi-os/apps/mobilei-os/node_modules/react-native/../..
+ cd /Users/davi.santos/Documents/fresh-rn-nx-appi-os/apps/mobilei-os/node_modules/react-native/../..
+ [[ -n /../src/main.tsx ]]
+ :
+ [[ false != true ]]
+ [[ ! -f /../src/main.tsx ]]
+ echo 'error: Entry file /../src/main.tsx does not exist. If you use another file as your entry point, pass ENTRY_FILE=myindex.js'
error: Entry file /../src/main.tsx does not exist. If you use another file as your entry point, pass ENTRY_FILE=myindex.js
+ exit 2
Environment
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Xcode archive getting cached react native ios - Stack Overflow
The debug build is working fine. It shows the current and updated code but when I'm creating a build in release mode or...
Read more >Creating an Apple App Clip with React Native - Adapptor
1) Open the project ios/ReactNativeTest.xcworkspace file in Xcode. 2) File -> New -> Target then select App Clip (This can be found most...
Read more >React native ios xcode producing corrupt archives
I have an app being built with React Native. When I go to archive it, the organizer doesn't open, but I can see...
Read more >Archiving iOS React Native app in an NRWL monorepo
The problem: iOS app runs normally when running it from Xcode, but archiving it in order to distribute on AppStoreConnect leads to nasty...
Read more >Speeding up Xcode archive builds with XcodeArchiveCache
Try changing pod versions, build settings and file contents in our sample project. Remove that SOME_FLAG=1 part from Cachefile and xcodebuild ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@davisantos-tag No you can just replace
export ENTRY_FILE=$(PROJECT_DIR)/../src/main.tsx
withexport ENTRY_FILE="${PROJECT_DIR}/../src/main.tsx"
in ios/.xcode.env file.Hi @carlos-kelly 😃
You mean, like this?
Thank you!