@@ -88,12 +88,31 @@ target 'jslibp2preactnative' do
88
88
end
89
89
end
90
90
91
+
92
+ # This provides a post_install workaround for build issues related Xcode 12.5 and Apple Silicon (M1) machines.
93
+ # Call this in the app's main Podfile's post_install hook.
94
+ # See https://github.com/facebook/react-native/issues/31480#issuecomment-902912841 for more context.
95
+ # Actual fix was authored by https://github.com/mikehardy.
96
+ # New app template will call this for now until the underlying issue is resolved.
91
97
def __apply_Xcode_12_5_M1_post_install_workaround ( installer )
98
+ # Flipper podspecs are still targeting an older iOS deployment target, and may cause an error like:
99
+ # "error: thread-local storage is not supported for the current target"
100
+ # The most reliable known workaround is to bump iOS deployment target to match react-native (iOS 11 now).
92
101
installer . pods_project . targets . each do |target |
93
102
target . build_configurations . each do |config |
94
- config . build_settings [ 'IPHONEOS_DEPLOYMENT_TARGET' ] = '17.0'
103
+ # ensure IPHONEOS_DEPLOYMENT_TARGET is at least 11.0
104
+ deployment_target = config . build_settings [ 'IPHONEOS_DEPLOYMENT_TARGET' ] . to_f
105
+ should_upgrade = deployment_target < 11.0 && deployment_target != 0.0
106
+ if should_upgrade
107
+ config . build_settings [ 'IPHONEOS_DEPLOYMENT_TARGET' ] = '11.0'
108
+ end
95
109
end
96
110
end
97
111
98
- `sed -i -e $'s/__IPHONE_10_0/__IPHONE_14_0/' Pods/RCT-Folly/folly/portability/Time.h`
112
+ # But... doing so caused another issue in Flipper:
113
+ # "Time.h:52:17: error: typedef redefinition with different types"
114
+ # We need to make a patch to RCT-Folly - remove the `__IPHONE_OS_VERSION_MIN_REQUIRED` check.
115
+ # See https://github.com/facebook/flipper/issues/834 for more details.
116
+ time_header = "#{ Pod ::Config . instance . installation_root . to_s } /Pods/RCT-Folly/folly/portability/Time.h"
117
+ `sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' '#{ time_header } '`
99
118
end
0 commit comments