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

fix: pod install with --project-directory #35754

Closed
wants to merge 1 commit into from

Conversation

dcangulo
Copy link
Contributor

@dcangulo dcangulo commented Dec 31, 2022

Summary

The variable version is previously used but in 2344860#diff-adcf572f001c2b710d14f409c14763f1a50b08369b3034548f1602685d21f67f, its usage have been removed the but the variable is kept.

It also raises an error when using bundle exec pod install --project-directory=ios which works on 0.70.X and below.

No such file or directory @ rb_sysopen - ../node_modules/react-native/package.json

/Users/davidangulo/Desktop/mobile/myapp/node_modules/react-native/scripts/react_native_pods.rb:212:in `read'
/Users/davidangulo/Desktop/mobile/myapp/node_modules/react-native/scripts/react_native_pods.rb:212:in `react_native_post_install'

Changelog

[IOS] [FIXED] - pod install with --project-directory

Test Plan

bundle exec pod install --project-directory=ios should not raise an error.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 31, 2022
@dcangulo dcangulo changed the title chore: remove unused variable fix: pod install with --project-directory Dec 31, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,493,253 +0
android hermes armeabi-v7a 7,813,845 +0
android hermes x86 8,969,058 +0
android hermes x86_64 8,827,238 +0
android jsc arm64-v8a 9,678,873 +0
android jsc armeabi-v7a 8,413,102 +0
android jsc x86 9,743,267 +0
android jsc x86_64 10,220,680 +0

Base commit: 4923a09
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 4923a09
Branch: main

@pull-bot
Copy link

PR build artifact for e93b7e9 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@pull-bot
Copy link

PR build artifact for e93b7e9 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@facebook-github-bot
Copy link
Contributor

@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@rshest
Copy link
Contributor

rshest commented Dec 31, 2022

CC @dmytrorykun to double check.

@facebook-github-bot
Copy link
Contributor

@rshest merged this pull request in efd39ee.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 31, 2022
@arnaudambro
Copy link

@dcangulo I have the exact same error with pod install with --project-directory

but when I go into the ./ios folder and pod install, no problem

@dcangulo
Copy link
Contributor Author

dcangulo commented Jan 18, 2023

@arnaudambro This issue should be fixed in 0.72.

For 0.71, you can do the following for a workaround.

post_install do |installer|
  react_native_post_install(
    installer,
+   'node_modules/react-native',
    # Set `mac_catalyst_enabled` to `true` in order to apply patches
    # necessary for Mac Catalyst builds
    :mac_catalyst_enabled => false
  )
  __apply_Xcode_12_5_M1_post_install_workaround(installer)
end

In your ios/Podfile.

@marcoj
Copy link

marcoj commented Jan 27, 2023

@arnaudambro This issue should be fixed in 0.72.

For 0.71, you can do the following for a workaround.

post_install do |installer|
  react_native_post_install(
    installer,
+   'node_modules/react-native',
    # Set `mac_catalyst_enabled` to `true` in order to apply patches
    # necessary for Mac Catalyst builds
    :mac_catalyst_enabled => false
  )
  __apply_Xcode_12_5_M1_post_install_workaround(installer)
end

In your ios/Podfile.

I'm using a monorepo and this worked perfectly, just needed to add the correct path. in my case: '../../../node_modules/react-native',

Thank!

@varemenos
Copy link

varemenos commented Jan 30, 2023

Doesn't this fix qualify for a 0.71.X cherry pick? Seems like it's worth including instead of waiting for another minor version release (0.72).

@dcangulo
Copy link
Contributor Author

dcangulo commented Feb 8, 2023

@varemenos #36096 would fix it for 0.71.X

OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
The variable `version` is previously used but in facebook@2344860#diff-adcf572f001c2b710d14f409c14763f1a50b08369b3034548f1602685d21f67f, its usage have been removed the but the variable is kept.

It also raises an error when using `bundle exec pod install --project-directory=ios` which works on `0.70.X` and below.

```txt
No such file or directory @ rb_sysopen - ../node_modules/react-native/package.json

/Users/davidangulo/Desktop/mobile/myapp/node_modules/react-native/scripts/react_native_pods.rb:212:in `read'
/Users/davidangulo/Desktop/mobile/myapp/node_modules/react-native/scripts/react_native_pods.rb:212:in `react_native_post_install'
```

## Changelog
[IOS] [FIXED] - pod install with --project-directory

Pull Request resolved: facebook#35754

Test Plan: `bundle exec pod install --project-directory=ios` should not raise an error.

Reviewed By: christophpurrer

Differential Revision: D42298517

Pulled By: rshest

fbshipit-source-id: bef0b03312d2029188ae5437e3baf3ffce5cb73f
facebook-github-bot pushed a commit that referenced this pull request Jun 26, 2023
Summary:
Exercise `pod install --project-directory=ios` when building the generated iOS project to make sure we don't regress in the future.

See also #37992, #35754, #34215, #33909

## Changelog:

[INTERNAL] [ADDED] - Exercise `pod install --project-directory=ios` when testing the iOS template

Pull Request resolved: #37996

Test Plan: CI should pass.

Reviewed By: dmytrorykun

Differential Revision: D46972815

Pulled By: cipolleschi

fbshipit-source-id: 69617b09ac599eba3dde3ddddcf08db95bfc4da3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants