question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t') when building latest react-native rc with macOS target

See original GitHub issue

🐛 Bug Report

Looks like there is a blocking build issue in flipper that is preventing the new macOS target to work when building with the latest react-native release candidate (0.62.0.rc-3) that embeds flipper.

Exact error:

[...]/SandboxProject_62RC3/ios/Pods/Headers/Private/Flipper-Folly/folly/portability/Time.h:51:17: Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t')

To Reproduce

  • Create a new react-native app using the latest release candidate
npx react-native init SandboxProject_62RC3 --version 0.62.0-rc.3
  • Open XCode
xed ios/
  • Enable macOS target (in Targets > General)
Screenshot 2020-02-26 at 19 00 47

Expected Behavior

Working build

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:46
  • Comments:105 (14 by maintainers)

github_iconTop GitHub Comments

134reactions
sturmentacommented, May 2, 2021

why this is still an issue 😕

@ShivamJoker try using like this in podfile

  use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
  post_install do |installer|
    flipper_post_install(installer)
  end

and then run pod install --repo-update

https://github.com/facebook/flipper/issues/2215#issuecomment-829102757

61reactions
ericschaalcommented, Mar 28, 2020

Same 😦

EDIT: Found a quick&dirty workaround Looking a few lines above the clockit_t typedef in Flipper-Foly Time.h

// OSX is a pain. The XCode 8 SDK always declares clock_gettime
// even if the target OS version doesn't support it, so you get
// an error at runtime because it can't resolve the symbol. We
// solve that by pretending we have it here in the header and
// then enable our implementation on the source side so that
// gets linked in instead.
#if __MACH__ &&                                                \
    (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 || \
     __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)

#ifdef FOLLY_HAVE_CLOCK_GETTIME
#undef FOLLY_HAVE_CLOCK_GETTIME
#endif

#define FOLLY_HAVE_CLOCK_GETTIME 1
#define FOLLY_FORCE_CLOCK_GETTIME_DEFINITION 1

#endif

I changed __IPHONE_10_0 to __IPHONE_12_0 (as my target iOS version is 11) and got it working. I guess the same can be done for MAC_OS_X_VERSION_10_12 to MAC_OS_X_VERSION_10_15 if you are targeting macOS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Build Error on IOS - typedef redefinition with ...
React Native Build Error on IOS - typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t') · Ask Question.
Read more >
RN Typedef redefinition with different types ('uint8_t' (aka ...
React Native version is 0.62.2, When I build in Xcode, ... with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t').
Read more >
[Solved]-React Native Build Error on IOS - typedef redefinition ...
Coding example for the question React Native Build Error on IOS - typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum...
Read more >
React Native Build Error On Ios Typedef Redefinition With - ADocLib
Typedef redefinition with different types 'uint8t' aka 'unsigned char' vs 'enum clockidt' when building latest reactnative rc with macOS target #834.
Read more >
Developers - Typedef redefinition with different types ('uint8_t ...
Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t') when building latest react-native rc with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found