3

My goal is to run a react native build (ios version).

Situation 1

  • Actions: start metro (ok)
  • build ios. Problem: build failed with exit code 1.
(CompileC /Users/macbook/Library/Developer/Xcode/DerivedData/NAME_OF_PROJECT-gxlagomyefvmjkdemiakcfycxnhx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/macbook/Documents/work/omg/mobile/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler)

Situation 2

  • Actions: build ios.
  • Problem: Flipper:: Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t'

Versions

  • xcode version 12.5
  • ios 9+
  • iphone 12

Some actions I tried that didn't work:

  1. solution 1

  2. solution 2

  3. reisntall all pods

  4. update all pods

  5. reclon project

    • rm -Rf Pods/*
    • pod cache clean --all
    • pod install

and a few other little fixes. Any help would be appreciated.

Sonny Parlin
  • 931
  • 2
  • 13
  • 28

3 Answers3

8

Change Podfile like below:

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
  end

Run pod install and it works!

Hoang Lam
  • 523
  • 8
  • 23
0

I also faced the same issue on my very first react-native project when I tried to run it on an ios simulator.

clockid_t

clockid_t is part of one of your systems. The error is actually for redefining clockid_t twice.

Renaming clockid_t to something else solved my problem. I renamed it from clockid_t to clockid_tt and then my project ran smoothly.

Because I'm a beginner react-native dev, I am not sure about whether this solution will create any future problems on my react-native project. Not yet faced any problem with this solution.

ouflak
  • 2,458
  • 10
  • 44
  • 49
0
If you have use_frameworks! enabled, Flipper will not work and you should disable these next few lines in your Podfile.


# use_flipper!()
#  post_install do |installer|
#    react_native_post_install(installer)
#   __apply_Xcode_12_5_M1_post_install_workaround(installer)
#  end

**OR**

# use_flipper! 
  # post_install do |installer|
  #   flipper_post_install(installer)
  # end
Raj Shah
  • 668
  • 1
  • 9
  • 23