I created the React project version 0.66.1. It's run well on Android but not in ios.
** BUILD FAILED ** The following build commands failed: CompileC /Users/nunggu/Library/Developer/Xcode/DerivedData/The_Shop_App-cbmtjvbjevexvvefqivkzkbmmaxa/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/arm64/SysUio.o /Users/nunggu/Documents/React\ Udemy/The_Shop_App/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods') (1 failure)
################################## { "name": "the_shop_app", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "react": "17.0.2", "react-native": "0.66.1" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } }
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.Community– Community Bot2021年10月26日 16:30:24 +00:00Commented Oct 26, 2021 at 16:30
-
Use react-native-community.github.io/upgrade-helper there are only a few new versions support the M1, but it could also be a different issueuser16967562– user169675622021年10月28日 08:51:06 +00:00Commented Oct 28, 2021 at 8:51
-
Still got errors.Genius To1– Genius To12021年10月29日 02:58:06 +00:00Commented Oct 29, 2021 at 2:58
-
check it react native project not build on MacBook M1Zuka Gaprindashvili– Zuka Gaprindashvili2021年12月02日 18:52:13 +00:00Commented Dec 2, 2021 at 18:52
1 Answer 1
After having tried many trials, I already found the solution. Just add the code to the Podfile in the ios folder as follows:
use_flipper!({ 'Flipper-Folly' => '2.6.0', 'Flipper' => '0.112.0', 'Flipper-RSocket' => '1.4.0' })
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
flipper_post_install(installer)
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
end
Flipper compatibility version as the link: https://cocoapods.org/pods/Flipper.