Si quelqu'un a encore cette erreur (je viens de mettre à jour Mac, Xcode, etc), vous pouvez corriger la construction sans désactiver Flipper et Hermes ; dans votre fichier Pod sous post_install
ajoutez simplement (je l'ai trouvé quelque part sur le web et l'ai modifié pour corriger les nouvelles erreurs des dernières mises à jour) :
post_install do |installer|
flipper_post_install(installer)
react_native_post_install(installer)
# # to build for the simulator on Apple M1
# installer.pods_project.targets.each do |target|
# target.build_configurations.each do |config|
# # disables arm64 builds for the simulator
# config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
# end
# end
## Fix for XCode 12.5 & RN 0.62.2 - See https://github.com/facebook/react-native/issues/28405
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(strongModule))", "RCTBridgeModuleNameForClass(Class(strongModule)))")
## Fix for Flipper-Folly on iOS 14.5
find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
"atomic_notify_one(state)", "folly::atomic_notify_one(state)")
find_and_replace("Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
"atomic_notify_one(state)", "folly::atomic_notify_one(state)")
find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
"atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")
end
Avant votre target
, ajouter
# fixes for last Mac updates
def find_and_replace(dir, findstr, replacestr)
Dir[dir].each do |name|
text = File.read(name)
replace = text.gsub(findstr,replacestr)
if text != replace
puts "Fix: " + name
File.open(name, "w") { |file| file.puts replace }
STDOUT.flush
end
end
Dir[dir + '*/'].each(&method(:find_and_replace))
end