. Advertisement .
..3..
. Advertisement .
..4..
The error: “React Native 0.64 won’t build iOS app” after upgrading Xcode to 12.5 and iOS to 14.5 is a common error that can show up in many ways. In this blog, we will go through some of the ways you can fix this issue. Read on.
How To Solve The Error: “React Native 0.64 won’t build iOS app” after upgrading Xcode to 12.5 and iOS to 14.5?
You may have difficulty running the iOS app on a real device or in the simulator after upgrading Xcode to 12.5 and iOS to 14.5. When using npm run iOS, you can get the following message:
The following build commands failed:
CompileC .../Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper-Folly.build/Objects-normal/x86_64/DistributedMutex.o /Users/guilherme/Documents/Dood/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
Approach 1: Pod install and rebuild performed
Pod install and rebuild performed as a temporary solution when you comment out Flipper in the Podfile.
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
# use_flipper!
# post_install do |installer|
# flipper_post_install(installer)
# end
Approach 2: Remove your /pods folder
If you receive a permissions issue when trying to access the DistributedMutex-inl.h file, simply remove your /pods folder and run pod install one more time.
Approach 3: Follow these steps
Follow these steps:
Step 1: Firstly, in your React Native project, access your Podfile.
Step 2: Add this to your Podfile’s post_install.
post_install do |installer|
flipper_post_install(installer)
## 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/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
"atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")
end
Step 3: In your Podfile, include the find_and_replace function as shown below. This feature can be placed elsewhere in the Podfile.
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
Step 4: Run the pod install command.
Step 5: Your problem should now be resolved.
Approach 4: Determine Flipper’s updated dependencies
Excepting the bove soltutions, there is another way to handle : “React Native 0.64 won’t build iOS app” after upgrading Xcode to 12.5 and iOS to 14.5 issue but not lose the function of Flipper. That great solution is determining Flipper’s updated dependencies in the Podfile. You can react some versions of Native as the following:
For reacting Native 62
def add_flipper_pods!(versions = {})
versions['Flipper'] ||= '~> 0.87.0'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.5.3'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.3.1'
cd ios && pod install
is good for you to use.
For reacting Native 64
Upgrade the version to 0.64.1 in the package.json
yarn install && pod install --repo-update && react-native run-ios
Conclusion
We hope you will enjoy our article about the error. With this knowledge, we know that you can fix your error: “React Native 0.64 won’t build iOS app” after upgrading Xcode to 12.5 and iOS to 14.5 quickly by following these steps! If you still have any other questions about fixing this syntax error, please leave a comment below. Thank you for reading!
Read more
Leave a comment