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

Issue With iOS Custom Build Path #19300

Closed
3 tasks done
kimihiro64 opened this issue May 16, 2018 · 4 comments
Closed
3 tasks done

Issue With iOS Custom Build Path #19300

kimihiro64 opened this issue May 16, 2018 · 4 comments
Labels
Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@kimihiro64
Copy link

kimihiro64 commented May 16, 2018

return `build/Build/Products/${configuration}-${device}/${appName}.app`;

This line doesn't seem to be working properly if you've modified Per-Configuration Build Products path in XCode project settings. I've changed it so that my other configurations all use the same build path, Debug and Release, instead of their full configuration name (had issues with pods that wouldn't work otherwise). XCode will utilize build/Build/Products/Debug-iphonesimulator/appname.app during the build process (I'm not really sure where it gets this value from), but then the react-native script will try and use DebugProd-iphonesimulator and not find what XCode just built. Is there a way to make sure the path XCode is using is utilized by this script? Or would it be better to pull the per-configuration build path here and replace iphoneos with iphonesimulator if necessary? The former sounds like the better long term solution, but the latter is probably a quicker fix.

EDIT: In the export logs during build, this seems to be the var we should pull directly for the path if we have access to it:
BUILT_PRODUCTS_DIR = /Users/<user>/<project>/ios/build/Build/Products/Debug-iphonesimulator

Environment

Environment:
OS: macOS High Sierra 10.13.3
Node: 9.9.0
Yarn: 1.5.1
npm: 5.8.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.1 AI-173.4670197

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.52.0 => 0.52.0

Steps to Reproduce

  1. Start with any out of the box application
  2. Add a build configuration in XCode
  3. Change the Per-Configuration Build Products Path in Build Locations settings in XCode for the added build configuration to anything besides the default $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) e.g. $(BUILD_DIR)/Debug$(EFFECTIVE_PLATFORM_NAME)
  4. Add a scheme which builds the new configuration
  5. react-native run-ios --scheme "$scheme" --configuration "$configuration"

Expected Behavior

run-ios should should load the .app bundle just built by XCode

Actual Behavior

run-ios is looking for the .app bundle in a different location than it was built

@react-native-bot
Copy link
Collaborator

It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?

@kimihiro64
Copy link
Author

The affected line of code is the same between 0.52 and 0.55, but I tried with latest just to be sure, still happens.

@kimihiro64 kimihiro64 changed the title Issue With Custom Build Path Issue With iOS Custom Build Path May 16, 2018
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label May 16, 2018
@stale
Copy link

stale bot commented Sep 10, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 10, 2018
@stale
Copy link

stale bot commented Sep 17, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Sep 17, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants