-
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
fix: use real_path to find plist files is update_ats Cocoapod util #42242
Conversation
This does add the following to each Info.plist in the project, which overwrites a warning in the default app target Info.plist and causes a diff change to the Info.plist in the "Tests" target. <key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict> Have to consider how to deal with that, as well as Evan Bacon's point about not modifying targets that aren't running a React Native dev server. |
packages/react-native/scripts/cocoapods/__tests__/test_utils/InstallerMock.rb
Outdated
Show resolved
Hide resolved
4e87215
to
8a761ba
Compare
Updated to use |
|
||
def initialize(name) | ||
@name = name | ||
@path = name | ||
@real_path = name |
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.
Is this accurate? Should we add the path to it also?
8a761ba
to
e7caf78
Compare
Closing until I can better work out some of the issues here. |
Summary:
This PR fixes a pod install failure detailed in #42239 which can occur when the
update_ats_in_plist
utility method in a Cocoapod script fails to find an Info.plist in the target folder. It does so by calling the Cocoapodsreal_path
method instead of justpath
on the file reference, which correctly adds the target folder to the path.Changelog:
[iOS] [Fixed] - Fix pod install error when update_ats unable to find Info.plist in targets
Test Plan:
Updated Ruby unit test:
Also tested using patch-package against my reproduction branch in: chriszs/reproducer-react-native#2
To test, clone the branch,
cd ReproducerApp
,yarn
,npx pod-install
. CI fails with "error Cannot start server in new window because no terminal app was specified" on the build step, but I believe that's unrelated.