Skip to content

Instantly share code, notes, and snippets.

@crisecheverria
Last active August 28, 2022 09:30
Show Gist options
  • Save crisecheverria/c738191b86a0572d4cff4807b3ddeef1 to your computer and use it in GitHub Desktop.
Save crisecheverria/c738191b86a0572d4cff4807b3ddeef1 to your computer and use it in GitHub Desktop.
Fix Flipper-Folly on iOS 14.5
target 'YourAPP' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
target 'YourAPP' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!({ 'Flipper-Folly' => '2.3.0' }) # <=== Step 1
post_install do |installer|
flipper_post_install(installer)
## Fix for Flipper-Folly on iOS 14.5 <=== Step 2
find_and_replace("Pods/Flipper-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
## Fix for Flipper-Folly on iOS 14.5 <=== Step 3
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
end
@crisecheverria
Copy link
Author

crisecheverria commented May 12, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment