'React Native Build Error on IOS - typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t')

After upgrading React Native from 0.61.5 to 0.63.2, Flipper causes an error on IOS as typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t')

On github there are a few proposed answers but none of them solved my problem https://github.com/facebook/flipper/issues/834

Is there anyone figured out how to solve this?

Many thanks



Solution 1:[1]

Note that 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|
  #   flipper_post_install(installer)
  # end

Solution 2:[2]

STEP 1:

Go to YOUR_PROJECT > ios > Podfile and then comment these lines

  # use_flipper!()

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

STEP 2:

after step 1 you have to run pod update command on YOUR_PROJECT > ios path.

Bingo its done.


IMPORTANT

In case you get some errors after doing above 2 steps,

  1. GO to YOUR_PROJECT > ios > YOUR_PROJECT_NAME > and run this command
  2. plutil ./Info.plist it will show you where the issue is.
  3. Then fix that issue from your text editor.

Solution 3:[3]

Update your pod file with below code.

use_flipper!({ 'Flipper-Folly' => '2.3.0' }) # update this part
 post_install do |installer|
   flipper_post_install(installer)
 end

Solution 4:[4]

I needed to specify the versions:

  # https://github.com/facebook/flipper/releases
  # https://cocoapods.org/pods/Flipper-Folly
  # https://cocoapods.org/pods/OpenSSL-Universal
  use_flipper!({
    "Flipper" => "0.134.0",
    "Flipper-Folly" => "2.6.10",
    "OpenSSL-Universal" => "1.1.1100"
  })

And for a full Podfile, it might help:

require_relative "../node_modules/expo/scripts/autolinking"
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.0"

target "socializus" do
  use_expo_modules!

  config = use_native_modules!

  use_react_native!(
    path: config[:reactNativePath],
    hermes_enabled: false
  )

  # https://github.com/facebook/flipper/releases
  # https://cocoapods.org/pods/Flipper-Folly
  # https://cocoapods.org/pods/OpenSSL-Universal
  use_flipper!({
    "Flipper" => "0.134.0",
    "Flipper-Folly" => "2.6.10",
    "OpenSSL-Universal" => "1.1.1100"
  })

  post_install do |installer|
    flipper_post_install(installer)
    react_native_post_install(installer)

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings.delete "IPHONEOS_DEPLOYMENT_TARGET"
      end
    end
  end
end

Solution 5:[5]

In my case, my XCode version was 11.5 and it was not supporting something newer in Flipper. Updating my XCode to version 12 fixed it immediately.

Solution 6:[6]

if you do not want to remove Flipper from your app then go through this solution.

your pod.file like this

add_flipper_pods!('Flipper' => '0.74.0')

upgrade Flipper-Folly by doing this

remove this line add_flipper_pods!('Flipper' => '0.74.0')

add this line add_flipper_pods!('Flipper-Folly' => '2.3.0')

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Denerator
Solution 2 Sultan Aslam
Solution 3 vijay kahar
Solution 4 Dorian
Solution 5 Ishita Sinha
Solution 6 Zoe stands with Ukraine