microsoft / react-native-macos

A framework for building native macOS apps with React.
https://microsoft.github.io/react-native-windows/
MIT License
3.45k stars 132 forks source link

Is __apply_Xcode_12_5_M1_post_install_workaround now obsolete? #2015

Closed jihoobyeon closed 8 months ago

jihoobyeon commented 8 months ago

Environment

react-native -v: 0.73.1
npm ls react-native-macos: 0.73.2
node -v: v20.10.0 (LTS)
npm -v: 10.2.3
yarn --version: 1.22.19
xcodebuild -version: Xcode 15.1 Build version 15C65

Steps to reproduce the bug

I made a new React Native project, ver. 0.73.1(latest), and added macOS support(ver 0.73.2), as always I do. But it throws this error:

Command `pod install` failed.
└─ Cause: An error occurred while processing the post-install hook of the Podfile.

undefined method `__apply_Xcode_12_5_M1_post_install_workaround' for #<Pod::Podfile:0x0000000106c6cf58 @defined_in_file=#<Pathname:/Users/jihoobyeon/Desktop/vm2025/macos/Podfile>, @internal_hash={"installation_method"=>{"name"=>"cocoapods", "options"=>{:deterministic_uuids=>false}}}, @root_target_definitions=[#<Pod::Podfile::TargetDefinition label=Pods>], @current_target_definition=#<Pod::Podfile::TargetDefinition label=Pods>, @post_install_callback=#<Proc:0x0000000106684b40 /Users/jihoobyeon/Desktop/vm2025/macos/Podfile:23>, @installation_options=#<Pod::Installer::InstallationOptions:0x0000000106b80568 @clean=true, @deduplicate_targets=true, @deterministic_uuids=false, @integrate_targets=true, @lock_pod_sources=true, @warn_for_multiple_pod_sources=true, @warn_for_unused_master_specs_repo=true, @share_schemes_for_development_pods=false, @disable_input_output_paths=false, @preserve_pod_file_structure=false, @generate_multiple_pod_projects=false, @incremental_installation=false, @skip_pods_project_generation=false, @parallel_pod_downloads=false, @parallel_pod_download_thread_pool_size=40>>

So I opened Podfile and commentated line __apply_Xcode_12_5_M1_post_install_workaround(installer), and now the error disappeared. but My Mac mini is using Apple Silicon, so I wondered it would work without that line.

Then I tested by running npx react-native run-macos and it worked! And I also tested by opening myproject.xcworkspace with Xcode and press run button and it also worked!

Thus I assume __apply_Xcode_12_5_M1_post_install_workaround(installer) is not required from ver 0.73... am I right? I'm confused, since that line is still included in default generated Podfile.

Expected Behavior

npx pod-install macos works without editing Podfile.

Actual Behavior

npx pod-install macos works if I remove line __apply_Xcode_12_5_M1_post_install_workaround(installer) from Podfile.

Reproducible Demo

No response

Additional context

No response

Mhp23 commented 8 months ago

@jihoobyeon, yes, it should be removed. I had a similar issue, and based on the macOS Podfile in the local-cli directory, it appears that we should remove __apply_Xcode_12_5_M1_post_install_workaround(installer). (it's not fixed on the latest stable release yet)

Saadnajmi commented 8 months ago

Hi, this method is indeed obsolete, I didn't realize it was still in our template. Please remove it from your apps, and we'll remove it from the template in the latest stable

jihoobyeon commented 8 months ago

Hi, this method is indeed obsolete, I didn't realize it was still in our template. Please remove it from your apps, and we'll remove it from the template in the latest stable

Okay, so it is obsolete now. @Saadnajmi, You may close this issue when fixed stable version comes out. Thanks!

Saadnajmi commented 8 months ago

0.73.4 should have the fix.