Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKIP_BUNDLING prevents generating packager host IP for debugging on iOS devices #20553

Closed
keatongreve opened this issue Aug 7, 2018 · 0 comments
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided.

Comments

@keatongreve
Copy link
Contributor

Duplicate of #17301, which was closed due to being stale.

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 165.44 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 9.11.2 - ~/.nvm/versions/node/v9.11.2/bin/node
      Yarn: 1.9.2 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v9.11.2/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, X 10.11, macOS 10.13, tvOS 11.4, watchOS 4.3
    IDEs:
      Android Studio: 3.1 AI-173.4720617
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1 
      react-native: 0.56.0 => 0.56.0 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

When setting SKIP_BUNDLING before a clean build of a React Native application for an iOS device (not a simulator), the ip.txt file is not generated in the build directory, preventing the application from getting the packager host's IP address in guessPackagerHost.

This only affects projects whose build directories have been cleaned; if the project has been built before when SKIP_BUNDLING is not set, ip.txt is generated and remains there even after SKIP_BUNDLING is later set.

Reproducible Demo

These steps describe building from Xcode, but a previous version of this issue describes reproducible steps using react-native run-ios. I built from Xcode to demonstrate in the Xcode debugger that a value is nil when it should not be.

  1. rimraf ~/Library/Developer/Xcode/DerivedData

  2. react-native init NewProject1

  3. open NewProject1/ios/NewProject1.xcodeproj

  4. Add export SKIP_BUNDLING=1 to the build phase Bundle React Native code and images screen shot 2018-08-06 at 8 40 08 pm

  5. Build and run the application on an iOS device

Expected behavior

Application generates a jsCodeLocation that includes packager host's IP address. i.e. http://192.168.0.19:8081/index.bundle?platform=ios&dev=true&minify=false
Application loads JS bundle from packager

Actual behavior

Application fails to load React Native view, with error No bundle URL present. Make sure you're running a packager server or...
screen shot 2018-08-06 at 8 52 41 pm
img_20180806_205309

@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Aug 7, 2018
@hramos hramos added the Resolution: PR Submitted A pull request with a fix has been provided. label Aug 20, 2018
kelset pushed a commit that referenced this issue Nov 26, 2018
Summary:
Fixes #20553.

Re-applies the change as described in #16533, which was closed for being stale. Thanks to emusgrave for the original PR/change.
Pull Request resolved: #20554

Differential Revision: D9414933

Pulled By: hramos

fbshipit-source-id: 8ebca57e32b905c4ecfd661524ca415f51162545
t-nanava pushed a commit to microsoft/react-native-macos that referenced this issue Jun 17, 2019
Summary:
Fixes facebook#20553.

Re-applies the change as described in facebook#16533, which was closed for being stale. Thanks to emusgrave for the original PR/change.
Pull Request resolved: facebook#20554

Differential Revision: D9414933

Pulled By: hramos

fbshipit-source-id: 8ebca57e32b905c4ecfd661524ca415f51162545
@facebook facebook locked as resolved and limited conversation to collaborators Aug 21, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants