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.

Catalyst + ReactNative: Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t') error when building for mac target

See original GitHub issue

Description

I’m getting the following errors when building for mac. This is a default application, created via react-native init. Error 1: Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t') Error 2: ld: in /Users/jh/Documents/projects/VST/Trial3/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, file '/Users/jh/Documents/projects/VST/Trial3/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture x86_64

React Native version:

MacOS: 10.15.4
Xcode: 11.4
RN: 0.62.0-rc.5
RN Cli: 4.8.0

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. react-native init App
  2. react-native run-ios - Works fine
  3. Open App.xcworkspace, select mac as a target and clean build.

Expected Results

Application working on Mac too.

Snack, code example, screenshot, or link to a repository:

image

I commented out the following line in Time.h:

//typedef uint8_t clockid_t;
extern "C" int clock_gettime(clockid_t clk_id, struct timespec* ts);
extern "C" int clock_getres(clockid_t clk_id, struct timespec* ts);
#endif

Then tried to build again and the Error 1 disappeared but Error 2 still exists: image

Should I do something for migration to build for mac?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

8reactions
RSRajendracommented, May 8, 2021

Just Comment use_flipper!() function inside podfile remove Pods and podfile.lock

again pod install worked for me

5reactions
0xmtncommented, May 4, 2020

I got it working by deleting Facebook Flipper and everything else related to it. Here are the steps to take:

  1. Open Podfile and delete everything related to Flipper and FlipperKit. There are some post-install functions, delete them too.
  2. rm -Rf Pods/*
  3. pod cache clean --all
  4. pod install
  5. Open AppDelegate.m and delete everything inside DEBUG.

image

image

  1. Hit Run and voila.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typedef redefinition with different types ('uint8_t' (aka ... - GitHub
Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t') when building latest react-native rc with macOS target #834.
Read more >
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, an error occur. ... with different types ('uint8_t' (aka 'unsigned char') vs 'enum...
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 >
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 macOS ...
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