From d8c3e901a9a8de8ba13b03f7c196a8e8d36fef9f Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 11 Dec 2020 15:58:26 +0100 Subject: [PATCH 1/3] better xcode 12 workaround --- scripts/react_native_pods.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index a77938c0510588..8592bb958c4995 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -108,3 +108,24 @@ def flipper_post_install(installer) end end end + +def react_native_post_install(installer) + projects = installer.aggregate_targets + .map{ |t| t.user_project } + .uniq{ |p| p.path } + .push(installer.pods_project) + + arm_value = `/usr/sbin/sysctl -n hw.optional.arm64 2>&1`.to_i + + projects.each do |project| + project.build_configurations.each do |config| + if arm_value == 1 then + config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" + else + config.build_settings.delete("EXCLUDED_ARCHS[sdk=iphonesimulator*]") + end + end + + project.save() + end +end From bcceab6c2165d5a9f72f77faca1dca80f27b98bb Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 11 Dec 2020 16:00:49 +0100 Subject: [PATCH 2/3] chore: update template --- template/ios/Podfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/template/ios/Podfile b/template/ios/Podfile index 6701249e83ac20..467c276b26d02a 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -16,9 +16,15 @@ target 'HelloWorld' do # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable these next few lines. - use_flipper! + # you should disable the next line. + use_flipper!() + post_install do |installer| - flipper_post_install(installer) + react_native_post_install(installer) + + # Enables Flipper. + # + # Disable the next line if you are not using Flipper. + flipper_post_install(installer) end -end +end \ No newline at end of file From bc19c50578ed15b398d5b21ab6b8938762a13ce3 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 14 Dec 2020 18:01:15 +0100 Subject: [PATCH 3/3] fix: if order --- scripts/react_native_pods.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 8592bb958c4995..df69dc160c6efa 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -120,9 +120,9 @@ def react_native_post_install(installer) projects.each do |project| project.build_configurations.each do |config| if arm_value == 1 then - config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" - else config.build_settings.delete("EXCLUDED_ARCHS[sdk=iphonesimulator*]") + else + config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end end