2

I want to build ios with xcode 12.4, ios14.4 with react native. the error like this

** BUILD FAILED **


The following build commands failed:
        PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/user/Library/Developer/Xcode/DerivedData/testIos2-gadmwivyqenuohhdfabybpprezqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00015310.sh
(1 failure)

Please someone help me, i am using intel mac os catalina and this my pod file

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false

production = ENV["PRODUCTION"] == "1"

target 'cobaIos' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :production => production,
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    :flipper_configuration => FlipperConfiguration.enabled,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'cobaIosTests' do
    inherit! :complete
    # Pods for testing
  end


  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

thank you i hope it can be solve because it takse 2 day and not solving anymore

  • Check out this https://stackoverflow.com/questions/66118122/lexical-or-preprocessor-issue-event2-event-config-h-file-not-found – Jitendrasinh Zala Jul 21 '22 at 05:45
  • Can you please add your pod file code here. – Iva Jul 21 '22 at 05:48
  • i have adding my podfile – Nicholas Lindartono Jul 21 '22 at 05:59
  • ok try : https://github.com/facebook/flipper/issues/2215#issuecomment-827422023 this one – Iva Jul 21 '22 at 06:17
  • i have check and same with the github code. i have try to make a new project yarn ios again. come error like this ```PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/user/Library/Developer/Xcode/DerivedData/testIos2-gadmwivyqenuohhdfabybpprezqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00015310.sh ``` – Nicholas Lindartono Jul 21 '22 at 06:28
  • in xcode the error like this ```/bin/sh: /Users/user/Desktop/Nicholas/Mobile: No such file or directory Command PhaseScriptExecution failed with a nonzero exit code``` – Nicholas Lindartono Jul 21 '22 at 06:31
  • The error happens if you use the wrong version of node. Try making sure you are using node 12.0. if react-native is 0.64.0 – Iva Jul 21 '22 at 07:04
  • if i use node 16, i must downgrade to node 12? – Nicholas Lindartono Jul 21 '22 at 07:05
  • also if it is m1 then issue will be resolved using this just run the nvm unalias default – Iva Jul 21 '22 at 07:06
  • my rn version 0.69.2 and node 16.16.0 – Nicholas Lindartono Jul 21 '22 at 07:06
  • zsh: command not found: nvm, i done have nvm – Nicholas Lindartono Jul 21 '22 at 07:07
  • ok for node 16. create project with npx react-native init – Iva Jul 21 '22 at 07:07
  • i have create new project with npx react-native init, but the same error like this in xcode ```/bin/sh: /Users/user/Desktop/Nicholas/Mobile: No such file or directory Command PhaseScriptExecution failed with a nonzero exit code``` and ```PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/user/Library/Developer/Xcode/DerivedData/cobaIos2-eebuhywmpdkvangjebxmuhhcvibv/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00015310.sh (1 failure)``` in react native – Nicholas Lindartono Jul 21 '22 at 07:10
  • please help me, i am new for develop ios device in react native – Nicholas Lindartono Jul 21 '22 at 07:11
  • your getting this error when you run pod install ? – Iva Jul 21 '22 at 07:12
  • no, yarn ios. pod install success but only yarn ios in simulator device – Nicholas Lindartono Jul 21 '22 at 07:14
  • Xcode -> File -> Workspace Setting -> change Build System to Legacy Build System. Note - Its not the ideal solution. – Iva Jul 21 '22 at 07:14
  • still the same error :( – Nicholas Lindartono Jul 21 '22 at 07:21
  • in build settings. if VALID_ARCHS was containing x86_64. After delete it. – Iva Jul 21 '22 at 07:22
  • i have the this tutorial image https://i.stack.imgur.com/3X9MM.png , but menu Valid Arch not found – Nicholas Lindartono Jul 21 '22 at 07:29
  • Go to Target > Architectures Set Build Active Architecture Only to YES and Excluded Architectures to x86_64 – Iva Jul 21 '22 at 07:32
  • in build setting menu? i can't change the setting – Nicholas Lindartono Jul 21 '22 at 07:36
  • https://stackoverflow.com/a/68581482/6654562 – Iva Jul 21 '22 at 07:46
  • i have change the setting of arch, i run again and got new error ,```The following build commands failed: Ld /Users/user/Library/Developer/Xcode/DerivedData/testIos-gxoxizdamvsolbfoyijjzpedgzny/Build/Products/Debug-iphonesimulator/testIos.app/testIos normal``` – Nicholas Lindartono Jul 21 '22 at 08:15
  • metro has started but get the error like before – Nicholas Lindartono Jul 21 '22 at 08:18
  • Restart the Mac it can be cache issue. Clear Derive data – Iva Jul 21 '22 at 08:20
  • i have restart mac and clear derive data. this error come ```CompileC /Users/user/Library/Developer/Xcode/DerivedData/testIos-gxoxizdamvsolbfoyijjzpedgzny/Build/Intermediates.noindex/testIos.build/Debug-iphonesimulator/testIos.build/Objects-normal/arm64/testIos_vers.o /Users/user/Library/Developer/Xcode/DerivedData/testIos-gxoxizdamvsolbfoyijjzpedgzny/Build/Intermediates.noindex/testIos.build/Debug-iphonesimulator/testIos.build/DerivedSources/testIos_vers.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler``` – Nicholas Lindartono Jul 21 '22 at 08:30
  • https://stackoverflow.com/a/63955114/6654562 – Iva Jul 21 '22 at 08:35
  • I suppose project is working. – Iva Jul 21 '22 at 10:55
  • i do the link arm 64 and get this error again, so confused. ```PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/user/Library/Developer/Xcode/DerivedData/iosCoba-bgiogopapvxlzwfmpjjsemxynwnf/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00015310.sh``` – Nicholas Lindartono Jul 21 '22 at 11:11

1 Answers1

0

The error is because of mix matched version of react native and flipper.

for react-native 63+ it should be following

use_flipper!({ 'Flipper' => '0.58.0' }) then run pod install

More more clarity go through this documentation for manual setup : https://fbflipper.com/docs/getting-started/react-native-ios/

Iva
  • 2,447
  • 1
  • 18
  • 28