-
Notifications
You must be signed in to change notification settings - Fork 954
Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t') when building latest react-native rc with macOS target #834
Comments
We fixed all known build issues last weeks, so bumping to rc.5 and bumping the Flipper version in your podfile to 0.33.1 should fix the issue. Would you mind verifying? |
Unfortunately I'm still hitting the same issue, (using rc.5 and bumping Flipper version from 0.30.2 to 0.33.1).
|
I encounter this issue even when not targeting MacOS with react-native 0.62.0. Previous definition is in iOS 13.2 header file
|
Any workaround? I'm getting same thing On a side note, error only occurs when running from XCode, it works when I run it like this: |
Same |
Same :( EDIT:
I changed |
cc @priteshrnandgaonkar Can you take a look? |
- Flipper errors when building for macos target - See: facebook/flipper#834
Same here for react-native 0.62. Only happens when I change my iOS deployment target from 9.0 to 10.3 (or anything above 9.0). Deployment target change is needed to install some dependencies for my project. |
@cayodonatti in my case even 9.0 fails. |
@kirill-konshin Did you change the values of other Pods? Default values are as follows.
Try changing these values, too. I hope it works out. |
Yes, all of them |
I created a brand new react-native app on version 0.62 and it built successfully and connected to Flipper. I will need more specific repro steps so that I can look into it. Bytw with 0.62 version RN supports Flipper out of the box. You don't have to do anything, so don't update the podfile's, it is done automatically. Looking forward for detailed repro steps so that I can look into it. |
@priteshrnandgaonkar this is what needs to be changed to repro:
Also had to change the main project to 10.3 |
Btw, I maintain my project since react-native 0.55 and this was never an issue. Deployment target version change is needed for a very big amount of libs in the RN ecosystem |
@cayodonatti I changed the deployment target of the app to 10.3 and it built for me. I just built created the brand new react native app and updated the deployment target. |
@priteshrnandgaonkar you need to add the postbuild hook, else it doesn't change the deployment target for the dependencies
|
@cayodonatti I was able to repro it with your podfile changes. I am looking into it. |
@cayodonatti Why do you have to update the dependencies to 10.3. Ideally one shouldn't update the deployment target of dependencies, isn't it ? |
@priteshrnandgaonkar In my specific case, I have two dependencies that require bumping of deployment targets: react-native-onesignal I'm by no means an iOS developer, so I wouldn't know why that's needed. From personal experience, if I do not bump deployment target for all dependencies CocoaPods doesn't let me even install them and complains that some dependencies have different deployment target requirements than the project. Also, this fix posted above fixes the issue for me:
Which leads me to think this could be a macro issue. |
@cayodonatti, there shouldn't be a need to update the deployment targets of dependencies, it feels like the way you are integrating those libraries may not be correct. You can change the |
@priteshrnandgaonkar I dug up my old code, and found the specific dep that requires iOS 10: https://github.com/Adyen/adyen-ios/blob/master/Adyen.podspec It's a native pod which I built my own bridge for. Anyway, this does not change the fact that I need to set my project to iOS 10+, since this is a payment thing and is needed for the app functionality. As I said, with the change above it works as intended. Edit: just adding to it, it is a very simple bridge which doesn't fiddle with any config on the native part. It's just the Adyen pod that has a strict requirement of iOS 10+, prolly because of some encrypt thing they use which was added later than 9.0. |
Still I will see if just changing your app's deployment target to 10+ works or not ? I don't think there should be a need to change all the deps to 10+ due to that. |
I'll test it and report ASAP. I think I did a bunch of changes at once and didn't test it thoroughly, will do it now. Thank you very much for the help |
I have installed my project from scratch from template, I have no custom pods or anything special. Yet no matter which target I set I get same error. I commented out this line and got this:
|
@priteshrnandgaonkar just confirming: the post-install hook is not really needed, and my project just ran fine without it with some minor adjustments. Thank you for your patience and for the help! |
Helped |
For those facing some issues on RN 0.65 the answer posted by kesha-antonov is correct, but he didn't explain why:
If you have some code that changes your pods deployment target it will fail for |
For RN 0.65, still getting same error with workaround. No problem building on RN 0.64.2. Cleaned out everything and same podfile as @kesha-antonov and also tried with different flipper versions. |
same for me.... |
Same here |
@ospfranco # Folly has issues when compiled with iOS 10 set as deployment target
# See https://github.com/facebook/folly/issues/1470 for details
spec.platforms = { :ios => "9.0", :tvos => "9.0" } So the problem occurs only if you set the deployment target for #if __MACH__ && \
((!defined(TARGET_OS_OSX) || TARGET_OS_OSX) && \
(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12)) || \
(TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)) <-- last condition fails
That leads to unsetting |
post_install do |installer|
react_native_post_install(installer)
# We need to make one crude patch to RCT-Folly - set `__IPHONE_10_0` to our iOS target + 1
# https://github.com/facebook/flipper/issues/834 - 84 comments and still going...
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
end (85 comments now! 😆 ) |
This is what I'm using: post_install do |installer|
# Run the React-Native post install
react_native_post_install(installer)
# Reconfigure the pods to match the iOS version we're targetting
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
case target.name
when 'RCT-Folly'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
else
config.build_settings.delete('IPHONEOS_DEPLOYMENT_TARGET')
end
end
end
end By removing the deployment target definition from the other pods, they will inherit that setting from the project. |
@yvbeek that sounds like a good idea, but then when you have a deployment target too low, you will get a problem - also in RCT-Folly ( post_install do |installer|
react_native_post_install(installer)
# Apple Silicon builds require a library path tweak for Swift library discovery or "symbol not found" for swift things
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.user_project.native_targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
end
end
aggregate_target.user_project.save
end
# Flipper requires a crude patch to bump up iOS deployment target, or "error: thread-local storage is not supported for the current target"
# I'm not aware of any other way to fix this one other than bumping iOS deployment target to match react-native (iOS 11 now)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
# ...but if you bump iOS deployment target, Flipper barfs again "Time.h:52:17: error: typedef redefinition with different types"
# We need to make one crude patch to RCT-Folly - set `__IPHONE_10_0` to our iOS target + 1
# https://github.com/facebook/flipper/issues/834 - 84 comments and still going...
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
end |
@mikehardy In our project we're using iOS 11, which I believe is now the recommended deployment target for the latest React-Native. I'm honestly not sure if React-Native still supports anything under iOS 10. For Folly the deployment target is set to iOS 9. |
I'm also set to 11. I needed each of those things in my post install 🤷 |
Any Solutions? |
@amitsharma-007 yeah, code with fancy highlighting right above, did you see it?
|
@mikehardy You are rock =) |
@litinskii hahaha thanks For what it's worth - anyone following along here should know I worked with the react-native release crew and this workaround (as well as the 2 others required currently for iOS builds) will be in the podfile template for new projects, and available for existing projects to call as a method from react-native core as a temporary workaround, but officially recognized, until the whole underlying issue is sorted. react-native-community/releases#246 (comment) Stated differently: the underlying problem is now very visible and should be fixed 🤞 |
I am still getting this error after adding the
|
@mikehardy tried your solution but facing the same issue
|
https://stackoverflow.com/help/minimal-reproducible-example apologies for the brevity - but it works for me from clean project init (I test via scripts) so burden is on you to show reproducible example please - can fix if problem is demonstrated |
I'm also having the same problem with react native 0.65.1. |
Please, before posting a metoo, someoe please post a reproduction? Because I have scripted / reproducible success with this: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh (actually - this commit if you are using react-native 0.65.1 mikehardy/rnfbdemo@3666d0e#diff-3e27ae623577d0c559bd8ab973a0c34af8cc65ef9beb9868a9cdb029854f8078 - the following commit is where I move to react-native 0.66.0-rc.1 since it incorporates my workarounds) To be completely clear: metoos have no value, reproducible examples posted as github repos have tremendous value. If there's no reproduction, there's no fix. |
@mikehardy I've created another repo with the exact same code/project and invited you as collaborator. I guess & hope you can use it to reproduce error. |
reproductions for public issues need to be public repos, sorry. Can you post a public repo starting from |
The In general, this Podfile is how we assert build compatibility between React Native and Flipper, so feel free to use it as reference point for future issues. Note that this doesn't solve the M1 issues, for which this patch can be used. On the long term we are working currently to become less/not reliant on Folly, which seems one of the biggest causes of build issues so far. Will try to share more details soon. |
Thanks Hero! |
@mikehardy I tried to copy your Podfile. but faced this issue. just for reference here is what my Podfile looks like.
|
You have version locks all over for the use_flipper section. If it's not working I imagine it's because of that. My versions were unlocked, I just have that one sed file edit in combo with the deployment target raise, and flipper compile goes through for me. |
@usama-homage the problem is that your Podfile uses Beyond that, let's not post new symptoms in closed issues. it makes the thread impossible to read. Please open new issues, with repro steps and linking to whatever closed issues that seems relevant. |
🐛 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:
To Reproduce
react-native
app using the latest release candidateExpected Behavior
Working build
The text was updated successfully, but these errors were encountered: