-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Change irrelevant Products path in ./local-cli/runIOS/runIOS.js #17963
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Three of the tests are failing, but it's unrelated to your PR. You can rebase past cc6d093 which should fix the failures. |
facebook#7308 and many of the same Seems like xcode cli tool isn't create ./build directory any more but place Products right inside ./Build (may check while creating single view ios application in XCode) * edit hardcoded path to {appName}.app
@hramos I think I've done what you suggest, but still got weird test failure for Android, besides my fix target only js codebase and could hardly affect Android part |
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.
@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: facebook#7308 and many of the same Seems like xcode cli tool isn't create ./build directory any more but place Products right inside ./Build (may check while creating single view ios application in XCode) * edit hardcoded path to {appName}.app <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Command `$ react-native run-ios` is often lead to `Entry, ":CFBundleIdentifier", Does Not Exist` I find out how to fix it in current version of RN and Xcode cli tools Just try to do `$ react native init {appName}` and then `$ react native run-ios` if everything fine it means my approach is right :) <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [-{Component}-] [ INTERNAL ] [ ENHANCEMENT ] [ {File} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| [CATEGORY] [TYPE] [LOCATION] - MESSAGE EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> Closes facebook#17963 Differential Revision: D7014984 Pulled By: hramos fbshipit-source-id: da62f130e6ebf7d3acd09d36525838d5c9684e75
Just to be precise, it seems that xcodebuild would create the folder in |
Ironically, if one would do |
With your path reverting those changes, seems to me the issue never existed? |
There're many issues that people describe as In this case I think OP fixed the issue, whatever it was, for himself by making this change and changing his Xcode project's local settings. |
Interesting. Thanks for explaining this a bit more. The pull request fixing this regression is landing soon. |
Summary: To date if you create a new `react-native@0.55.0` 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 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 #18700 Differential Revision: D7555096 Pulled By: hramos fbshipit-source-id: d877b867e89256f4356f22781d78308affbb9d9c
Summary: To date if you create a new `react-native@0.55.0` 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 `react-native@0.55.0` 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: facebook/react-native#7308 and many of the same Seems like xcode cli tool isn't create ./build directory any more but place Products right inside ./Build (may check while creating single view ios application in XCode) * edit hardcoded path to {appName}.app <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Command `$ react-native run-ios` is often lead to `Entry, ":CFBundleIdentifier", Does Not Exist` I find out how to fix it in current version of RN and Xcode cli tools Just try to do `$ react native init {appName}` and then `$ react native run-ios` if everything fine it means my approach is right :) <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [-{Component}-] [ INTERNAL ] [ ENHANCEMENT ] [ {File} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| [CATEGORY] [TYPE] [LOCATION] - MESSAGE EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> Closes facebook/react-native#17963 Differential Revision: D7014984 Pulled By: hramos fbshipit-source-id: da62f130e6ebf7d3acd09d36525838d5c9684e75
#7308
and many of the same
Seems like xcode cli tool isn't create ./build directory any more but place Products
right inside ./Build (may check while creating single view ios application
in XCode)
Motivation
Command
$ react-native run-ios
is often lead toEntry, ":CFBundleIdentifier", Does Not Exist
I find out how to fix it in current version of RN and Xcode cli tools
Test Plan
Just try to do
$ react native init {appName}
and then$ react native run-ios
if everything fine it means my approach is right :)Release Notes