react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

Can not build from xcode

Open da1z opened this issue 3 years ago • 2 comments

I am able to run demo app on emulator by running 'npm run ios' successfully following steps from docs but when I am trying to run demo app on device from xcode I get build error: error The resource ..../react-native-ui-lib/index.js was not found.

Can run demo on emulator from xcode. After running on emulator trying to run on device with Run without building and getting 'No code signature found.'

da1z avatar Jun 14 '22 08:06 da1z

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 14 '22 03:08 stale[bot]

Why this happen:

The reason is in node_modules/react-native/scripts/react-native-xcode.sh:

if [[ "$PLATFORM_NAME" == *simulator ]]; then
  if [[ "$FORCE_BUNDLING" ]]; then
    echo "FORCE_BUNDLING enabled; continuing to bundle."
  else
    # 👇 here
    echo "Skipping bundling in Debug for the Simulator (since the packager bundles for you). Use the FORCE_BUNDLING flag to change this behavior."
    exit 0;
  fi
else
  echo "Bundling for physical device. Use the SKIP_BUNDLING flag to change this behavior."
fi

So in simulator environment, entryfile will be resolved when running app and its name was determined by return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"demo"]; in AppDelegate.mm

Resolution:

Because metro.config.js not support config entry file path, so we need manully set ENTRY_FILE env to solve this: image

XHMM avatar Aug 26 '22 11:08 XHMM

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 29 '22 00:10 stale[bot]