'Error: main.jsbundle does not exist. This must be a bug with

My React Native app works fine in iOS debug mode. But, when I tried to run the app in release mode from xCode, I am getting a build error. However, in android it works fine in both debug and release mode.

File /Xcode/DerivedData/myapp-ewjafyqwkgvybabvuzpfqtubujvv/Build/Products/Release-iphonesimulator/ios.app/main.jsbundle does not exist. This must be a bug with.

I tried replacing the Build Phases > Bundle React Native code and images with the following code, but still, I am getting the above error.

cd $PROJECT_DIR/..
export NODE_BINARY=node
./node_modules/react-native/scripts/react-native-xcode.sh

Dependencies used in my project are:

"dependencies": {
    "@apollo/react-hooks": "^4.0.0",
    "@expo/vector-icons": "^12.0.5",
    "@homielab/react-native-auto-scroll": "^0.0.8",
    "@react-native-async-storage/async-storage": "^1.15.15",
    "@react-native-clipboard/clipboard": "^1.8.4",
    "@react-navigation/native": "^5.9.4",
    "@walletconnect/react-native-dapp": "^1.6.6",
    "apollo-client": "^2.6.10",
    "axios": "^0.21.1",
    "base-64": "1.0.0",
    "bignumber.js": "^9.0.2",
    "buffer": "6.0.3",
    "currency-formatter": "^1.5.8",
    "ethereumjs-abi": "^0.6.8",
    "expo": "~42.0.0",
    "expo-app-loading": "^1.1.2",
    "expo-font": "~9.2.1",
    "expo-linear-gradient": "~9.1.0",
    "expo-linking": "^2.2.3",
    "expo-splash-screen": "~0.11.2",
    "expo-status-bar": "~1.0.4",
    "expo-updates": "~0.8.1",
    "graphql": "^15.5.1",
    "humanize-duration": "^3.27.0",
    "kilomega": "^1.0.4",
    "moment": "^2.29.1",
    "nanoid": "^3.1.12",
    "node-libs-browser": "2.2.1",
    "path-browserify": "0.0.0",
    "query-string": "^7.0.1",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "~0.63.4",
    "react-native-auto-scrolling": "^3.0.2",
    "react-native-awesome-marquee": "^1.1.3",
    "react-native-crypto": "2.2.0",
    "react-native-dotenv": "^3.2.0",
    "react-native-fast-image": "^8.5.11",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-get-random-values": "1.5.0",
    "react-native-localhost": "1.0.0",
    "react-native-marquee": "^0.3.2",
    "react-native-modal": "^13.0.0",
    "react-native-picker-select": "^8.0.4",
    "react-native-reanimated": "~2.2.0",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.4.0",
    "react-native-side-menu": "^1.1.3",
    "react-native-side-menu-updated": "^1.3.2",
    "react-native-stream": "0.1.9",
    "react-native-svg": "12.1.1",
    "react-native-text-ticker": "^1.14.0",
    "react-native-textinput-effects": "^0.6.2",
    "react-native-unimodules": "~0.14.5",
    "react-native-web": "~0.13.12",
    "react-native-webview": "^11.6.5",
    "react-native-youtube-iframe": "^2.1.2",
    "react-redux": "^7.2.4",
    "react-router-native": "^5.2.0",
    "react-router-native-animate-stack": "^1.3.2",
    "redux": "^4.1.0",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0",
    "rn-nodeify": "^10.3.0",
    "vendor-copy": "^3.0.1",
    "walletconnect": "^1.6.5",
    "web3": "^1.5.2"
  }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source