question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React native entry file breaking iOS archive command on Xcode

See original GitHub issue

Trying to archive(Product->Archive) a version locally on Xcode, the command is breaking returning an entry file issue.

Current Behavior

image

Expected Behavior

Get the app properly archived from Xcode.

Steps to Reproduce

  1. Create a fresh react native app using the nrwl boilerplate(npx create-nx-workspace freshRnNxAppiOS --preset=react-native --appName=mobileiOS).
  2. Runs the npx nx run mobilei-os:run-ios command
  3. Open Xcode and select the proper target to archive: image
  4. 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

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

7reactions
mucahit-tekincommented, Aug 16, 2022

@davisantos-tag No you can just replace

export ENTRY_FILE=$(PROJECT_DIR)/../src/main.tsx with export ENTRY_FILE="${PROJECT_DIR}/../src/main.tsx" in ios/.xcode.env file.

3reactions
davisantos-tagcommented, Aug 2, 2022

Hi @carlos-kelly 😃

You mean, like this? image

Thank you!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found