Workaround RNReanimated pod install failure#5908
Closed
mokagio wants to merge 20 commits intoupgrade/react-native-0.71-iosfrom
Closed
Workaround RNReanimated pod install failure#5908mokagio wants to merge 20 commits intoupgrade/react-native-0.71-iosfrom
pod install failure#5908mokagio wants to merge 20 commits intoupgrade/react-native-0.71-iosfrom
Conversation
The issue is due to RNReanimated looking for react-native in the
node_modules relative to its location, which is how most projects would
be setup. Unfortunately, our projects is not standard.
When running `pod install` or `pod update`, we'd get:
```
Installing RNReanimated 2.17.0 (was 2.9.1-wp-4)
internal/modules/cjs/loader.js:934
throw err;
^
Error: Cannot find module 'react-native/package.json'
Require stack:
- /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/[eval]
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
at Function.resolve (internal/modules/cjs/helpers.js:113:19)
at [eval]:1:9
at Script.runInThisContext (vm.js:134:12)
at Object.runInThisContext (vm.js:310:38)
at internal/process/execution.js:81:19
at [eval]-wrapper:6:22
at evalScript (internal/process/execution.js:80:60)
at internal/main/eval_string.js:27:3 {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/[eval]'
]
}
[!] Invalid `RNReanimated.podspec` file: no implicit conversion of nil into String.
# from /var/folders/dq/cdqxvx3s5ps75564rpmb_dc00000gn/T/d20230627-89428-abwplk/RNReanimated.podspec:5
# -------------------------------------------
# reanimated_package_json = JSON.parse(File.read(File.join(__dir__, "package.json")))
> config = find_config()
# assert_no_multiple_instances(config)
# -------------------------------------------
```
|
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
This reverts commit ccfd998.
Using only our custom specs, the build failed with ``` Multiple commands produce '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/CallbackWrapper.h' - Target 'ReactCommon' (project 'Pods') has copy command from '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/ReactCommon/react/bridging/CallbackWrapper.h' to '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/CallbackWrapper.h' - Target 'ReactCommon' (project 'Pods') has copy command from '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/ReactCommon/react/nativemodule/core/ReactCommon/CallbackWrapper.h' to '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/CallbackWrapper.h' ``` However, with this setup the build fails with: ``` /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/../../gutenberg/node_modules/react-native/React/FBReactNativeSpec/../../scripts/xcode/with-environment.sh: line 35: .xcode.env: command not found /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/../../gutenberg/node_modules/react-native/React/FBReactNativeSpec/../../scripts/xcode/with-environment.sh: line 35: node: command not found [Warning] You need to configure your node path in the environment. You can set it up quickly by running: echo 'export NODE_BINARY=' > .xcode.env in the ios folder. This is needed by React Native to work correctly. We fallback to the DEPRECATED behavior of finding . This will be REMOVED in a future version. You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/../../gutenberg/node_modules/react-native/React/FBReactNativeSpec/../../scripts/xcode/with-environment.sh: line 41: /scripts/find-node-for-xcode.sh: No such file or directory [Error] Could not find node. It looks like that the .xcode.env or .xcode.env.local ```
This way, users can override what CocoaPods does without modifying the codebase via the `.local` file.
mokagio
commented
Jun 28, 2023
Comment on lines
+27
to
+32
| # This should already be set by the Podfile and seems to work locally, but somethog does not work in CI. | ||
| # See https://buildkite.com/automattic/gutenberg-mobile/builds/6327#0188fad1-932d-4a37-9d84-811937d8af18/435-455 | ||
| export REACT_NATIVE_NODE_MODULES_DIR="$PWD/../gutenberg/node_modules" | ||
| echo "+++ :bug: RN location" | ||
| echo "$REACT_NATIVE_NODE_MODULES_DIR" | ||
|
|
Contributor
Author
There was a problem hiding this comment.
I think this can be removed now. Most likely, the problem in CI was that we didn't have the node_modules
mokagio
added a commit
to wordpress-mobile/WordPress-iOS
that referenced
this pull request
Jun 28, 2023
Otherwise, we're getting a compilation failure. See wordpress-mobile/WordPress-iOS@eadad98#commitcomment-119894859
Hermes is the new JavaScript engine in React Native which comes enabled in the version we upgraded to, 0.71. See https://reactnative.dev/docs/hermes Notice the hack in the `Podfile` from facebook/react-native#35863
b77ceee to
f1fde4c
Compare
4 tasks
Contributor
Author
|
Closing in favor of #5912, which implements all of this changes and support toggling the Hermes engine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closed in favor of #5912, which implements all of this changes and support toggling the Hermes engine.
Points RNReanimated to a custom branch to work around 2.17.0 issue
The issue is due to RNReanimated looking for react-native in the
node_modulesrelative to its location, which is how most projects would be setup. Unfortunately, our projects is not standard.When running
pod installorpod update, we'd get: