1

I am facing issue in react-native project. It's working fine in android but build failed in iOS version. I have already tried all possible solution, but didn't get any solution.

The main problem is PhaseScriptExecution.

Xcode version - 12.4

Mac OS version - 11.3 (Big Sur)

npm version - 7.10.0

react-native version - 0.64.0

react version - 17.0.1

For mode detail, i am attaching the screenshot.

/Users/mmdev1/Library/Developer/Xcode/DerivedData/PRJ22-edpcityjusyktkdaxtnvzawndbxa/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-99DF087F7D2E061B36AA638AA7C0AD26.sh: line 4: 16519 Segmentation fault: 11 bash -l -c 'SRCS_DIR=/Users/mmdev1/Documents/RN/PRJ22/node_modules/react-native/scripts/../Libraries CODEGEN_MODULES_OUTPUT_DIR=/Users/mmdev1/Documents/RN/PRJ22/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec CODEGEN_MODULES_LIBRARY_NAME=FBReactNativeSpec /Users/mmdev1/Documents/RN/PRJ22/node_modules/react-native/scripts/generate-specs.sh' 2>&1

enter image description here enter image description here enter image description here

7
  • Could you share the content at line 4 of the /Users/mmdev1/Library/.../FBReactNativeSpec.build/Script-99F08...sh file in the last screenshot?
    – MaartenDev
    May 4, 2021 at 12:37
  • /Users/mmdev1/Library/Developer/Xcode/DerivedData/PRJ22-edpcityjusyktkdaxtnvzawndbxa/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-X.sh: line 4: 16519 Segmentation fault: 11 bash -l -c 'SRCS_DIR=/Users/mmdev1/Documents/RN/PRJ22/node_modules/react-native/scripts/../Libraries CODEGEN_MODULES_OUTPUT_DIR=/Users/mmdev1/Documents/RN/PRJ22/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec CODEGEN_MODULES_LIBRARY_NAME=FBReactNativeSpec /Users/mmdev1/Documents/RN/PRJ22/node_modules/react-native/scripts/generate-specs.sh' 2>&1 May 4, 2021 at 12:57
  • Which is your machine? Apple M1 chip?
    – ABM
    May 4, 2021 at 13:43
  • Could you share the content of line 4 of that sh file?
    – MaartenDev
    May 4, 2021 at 13:48
  • I have intel chip, not apple M1. May 5, 2021 at 4:39

1 Answer 1

2

I was getting the same failure, and I have not been able to pinpoint exactly why this works, but in my package.json I changed

"scripts": {
    "ios": "react-native run-ios",
}

to

"scripts": {
    "ios": "unset PREFIX && react-native run-ios",
}

As I was seeing some issues regarding the PREFIX env variable when using Node Versioning Manager (nvm).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.