-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Fix installing step of run-ios
command
#18700
Conversation
Does this work with Xcode 9.3 as well? |
Good point. Will check. |
@hramos I've made some checks. With Xcode 9.3 So it seems that referenced PR that introduced this regression wasn't motivated by Xcode version update. |
I can confirm this fixes issues on 0.55 branch. |
@facebook-github-bot shipit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grabbou is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: To date if you create a new `[email protected]` project and try to build/run it for iOS via CLI, e.g. by running: ``` $ react-native init test $ cd test $ react-native run-ios --no-packager ``` the build would succeed, but installing will fail afterwards: ``` ** BUILD SUCCEEDED ** Installing Build/Products/Debug-iphonesimulator/test.app An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Failed to install the requested application An application bundle was not found at the provided path. Provide a valid path to the desired application bundle. Print: Entry, ":CFBundleIdentifier", Does Not Exist Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier Build/Products/Debug-iphonesimulator/test.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist ``` This fail happens because `/usr/libexec/PlistBuddy` can't find `Info.plist` file at the provided path. This is a regression introduced by changes from PR facebook#17963 (accepted in facebook@5447ca6). If you execute test plan from that PR, it would fail. As per why: By default, `run-ios` process's working directory is `$PROJECT_DIR/ios`. According to [this line in `runIOS.js`](https://github.com/facebook/react-native/blob/3cd2b4342653d0cc6edfc9e7d436d73bfb4f139f/local-cli/runIOS/runIOS.js#L184), `xcodebuild` places all artifacts in `build` directory. And the default Xcode paths for products is `Build/Products` (at least of Xcode 9.2 which I use, and Xcode 9.3 which I tested this with also). So, the required `Info.plist` file is actually being created at `$PROJECT_DIR/ios/build/Build/Products/Debug-iphonesimulator/test.app/Info.plist` (with double `build`, the first from `derivedDataPath` key, the second from default products path). Relatively to `run-ios` process's working directory, the path of the file is `build/Build/Products/Debug-iphonesimulator/test.app/Info.plist`. PR facebook#17963 changed correct path to incorrect, thus introducing this regression. If changes from that PR are reverted, CLI doesn't fail on install step. I catch this error on both existing project and a freshly created test project. I can build/run an app from Xcode just fine, but running from CLI still would fail. The other workaround is to change path of products artifacts in Xcode, which is user settings and therefore can't be commited to a project's repo with VCS. Run: ``` $ react-native init test $ cd test $ react-native run-ios --no-packager ``` Ensure that it doesn't fail on install step and produce output similar to this: ``` Installing build/Build/Products/Debug-iphonesimulator/test.app Launching org.reactjs.native.example.test ``` [CLI][BUGFIX][local-cli/runIOS/runIOS.js] - Fix failing of `run-ios` command on install step Closes facebook#18700 Differential Revision: D7555096 Pulled By: hramos fbshipit-source-id: d877b867e89256f4356f22781d78308affbb9d9c
@angly-cat i've been struggling with #7308 for the past few days, eventually digging into code to fix the issue by reverting this change. here's my setup:
|
@kranzky Do you have default derived data path settings in Xcode? Is it a fresh project that fails for you? |
@angly-cat you're right, I did alter these settings while trying to fix the issue. here are the current settings: I tested by creating a new project (TL;DR: it fails with the same error, and Xcode settings are the same):
Confirmed it fails with a new project, and that the Xcode settings of the new project are the same as what I was using. |
I'm wondering whether some developers have their filesystem set to case-sensitive filenames? that may explain why If that's the issue, changing the |
Have you tried creating a new project using
My macOS is case-insensitive and it still creates paths with two Can you show the bottom path of that window, the most interesting part? Check the paths I have: As you can see,
But for you, it's vise versa? First two are not prepended, but the third is. That's strange. |
same error with
|
@angly-cat great, changing my preference to "unique" fixes the issue. thanks for your help 👍 |
@kranzky You're welcome 😸 |
As a temporary solution (just to get it up and running) I changed line 249 of
|
Summary: To date if you create a new `[email protected]` project and try to build/run it for iOS via CLI, e.g. by running: ``` $ react-native init test $ cd test $ react-native run-ios --no-packager ``` the build would succeed, but installing will fail afterwards: ``` ** BUILD SUCCEEDED ** Installing Build/Products/Debug-iphonesimulator/test.app An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Failed to install the requested application An application bundle was not found at the provided path. Provide a valid path to the desired application bundle. Print: Entry, ":CFBundleIdentifier", Does Not Exist Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier Build/Products/Debug-iphonesimulator/test.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist ``` This fail happens because `/usr/libexec/PlistBuddy` can't find `Info.plist` file at the provided path. This is a regression introduced by changes from PR facebook#17963 (accepted in facebook@5447ca6). If you execute test plan from that PR, it would fail. As per why: By default, `run-ios` process's working directory is `$PROJECT_DIR/ios`. According to [this line in `runIOS.js`](https://github.com/facebook/react-native/blob/3cd2b4342653d0cc6edfc9e7d436d73bfb4f139f/local-cli/runIOS/runIOS.js#L184), `xcodebuild` places all artifacts in `build` directory. And the default Xcode paths for products is `Build/Products` (at least of Xcode 9.2 which I use, and Xcode 9.3 which I tested this with also). So, the required `Info.plist` file is actually being created at `$PROJECT_DIR/ios/build/Build/Products/Debug-iphonesimulator/test.app/Info.plist` (with double `build`, the first from `derivedDataPath` key, the second from default products path). Relatively to `run-ios` process's working directory, the path of the file is `build/Build/Products/Debug-iphonesimulator/test.app/Info.plist`. PR facebook#17963 changed correct path to incorrect, thus introducing this regression. If changes from that PR are reverted, CLI doesn't fail on install step. I catch this error on both existing project and a freshly created test project. I can build/run an app from Xcode just fine, but running from CLI still would fail. The other workaround is to change path of products artifacts in Xcode, which is user settings and therefore can't be commited to a project's repo with VCS. Run: ``` $ react-native init test $ cd test $ react-native run-ios --no-packager ``` Ensure that it doesn't fail on install step and produce output similar to this: ``` Installing build/Build/Products/Debug-iphonesimulator/test.app Launching org.reactjs.native.example.test ``` [CLI][BUGFIX][local-cli/runIOS/runIOS.js] - Fix failing of `run-ios` command on install step Closes facebook#18700 Differential Revision: D7555096 Pulled By: hramos fbshipit-source-id: d877b867e89256f4356f22781d78308affbb9d9c
Summary: To date if you create a new `[email protected]` project and try to build/run it for iOS via CLI, e.g. by running: ``` $ react-native init test $ cd test $ react-native run-ios --no-packager ``` the build would succeed, but installing will fail afterwards: ``` ** BUILD SUCCEEDED ** Installing Build/Products/Debug-iphonesimulator/test.app An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Failed to install the requested application An application bundle was not found at the provided path. Provide a valid path to the desired application bundle. Print: Entry, ":CFBundleIdentifier", Does Not Exist Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier Build/Products/Debug-iphonesimulator/test.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist ``` This fail happens because `/usr/libexec/PlistBuddy` can't find `Info.plist` file at the provided path. This is a regression introduced by changes from PR #17963 (accepted in facebook/react-native@5447ca6). If you execute test plan from that PR, it would fail. As per why: By default, `run-ios` process's working directory is `$PROJECT_DIR/ios`. According to [this line in `runIOS.js`](https://github.com/facebook/react-native/blob/3cd2b4342653d0cc6edfc9e7d436d73bfb4f139f/local-cli/runIOS/runIOS.js#L184), `xcodebuild` places all artifacts in `build` directory. And the default Xcode paths for products is `Build/Products` (at least of Xcode 9.2 which I use, and Xcode 9.3 which I tested this with also). So, the required `Info.plist` file is actually being created at `$PROJECT_DIR/ios/build/Build/Products/Debug-iphonesimulator/test.app/Info.plist` (with double `build`, the first from `derivedDataPath` key, the second from default products path). Relatively to `run-ios` process's working directory, the path of the file is `build/Build/Products/Debug-iphonesimulator/test.app/Info.plist`. PR #17963 changed correct path to incorrect, thus introducing this regression. If changes from that PR are reverted, CLI doesn't fail on install step. I catch this error on both existing project and a freshly created test project. I can build/run an app from Xcode just fine, but running from CLI still would fail. The other workaround is to change path of products artifacts in Xcode, which is user settings and therefore can't be commited to a project's repo with VCS. Run: ``` $ react-native init test $ cd test $ react-native run-ios --no-packager ``` Ensure that it doesn't fail on install step and produce output similar to this: ``` Installing build/Build/Products/Debug-iphonesimulator/test.app Launching org.reactjs.native.example.test ``` [CLI][BUGFIX][local-cli/runIOS/runIOS.js] - Fix failing of `run-ios` command on install step Closes facebook/react-native#18700 Differential Revision: D7555096 Pulled By: hramos fbshipit-source-id: d877b867e89256f4356f22781d78308affbb9d9c
To date if you create a new
[email protected]
project and try to build/run it for iOS via CLI, e.g. by running:the build would succeed, but installing will fail afterwards:
This fail happens because
/usr/libexec/PlistBuddy
can't findInfo.plist
file at the provided path.This is a regression introduced by changes from PR #17963 (accepted in 5447ca6). If you execute test plan from that PR, it would fail.
As per why:
By default,
run-ios
process's working directory is$PROJECT_DIR/ios
.According to this line in
runIOS.js
,xcodebuild
places all artifacts inbuild
directory.And the default Xcode paths for products is
Build/Products
(at least of Xcode 9.2 which I use, and Xcode 9.3 which I tested this with also).So, the required
Info.plist
file is actually being created at$PROJECT_DIR/ios/build/Build/Products/Debug-iphonesimulator/test.app/Info.plist
(with doublebuild
, the first fromderivedDataPath
key, the second from default products path). Relatively torun-ios
process's working directory, the path of the file isbuild/Build/Products/Debug-iphonesimulator/test.app/Info.plist
.PR #17963 changed correct path to incorrect, thus introducing this regression.
If changes from that PR are reverted, CLI doesn't fail on install step.
I catch this error on both existing project and a freshly created test project. I can build/run an app from Xcode just fine, but running from CLI still would fail. The other workaround is to change path of products artifacts in Xcode, which is user settings and therefore can't be commited to a project's repo with VCS.
Test Plan
Run:
Ensure that it doesn't fail on install step and produce output similar to this:
Related PRs
#17963
Release Notes
[CLI][BUGFIX][local-cli/runIOS/runIOS.js] - Fix failing of
run-ios
command on install step