datetimepicker: When running in Xcode 15.3 getting Incompatible function pointer types passing 'YGSize (...)' exception
Bug report
I’ve updated to the most recent Xcode 15.3 and build started to fail with:
Incompatible function pointer types passing 'YGSize (YGNodeRef, float, YGMeasureMode, float, YGMeasureMode)' (aka 'struct YGSize (struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)') to parameter of type 'YGMeasureFunc' (aka 'struct YGSize (*)(const struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)')
Any idea what can be wrong with it?
Getting the issue
"react-native": "0.73.1",
"@react-native-community/datetimepicker": "^7.6.2",
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Reactions: 87
- Comments: 50 (2 by maintainers)
Same, I changed YGNodeRef to YGNodeConstRef in RNDateTimePickerShadowView.m line 44 (in function RNDateTimePickerShadowViewMeasure) and everything seems back to normal 😃
🎉 This issue has been resolved in version 7.6.3 🎉
If this package helps you, consider sponsoring us! 🚀
@mphill The patch-package library is an excellent way of temporarily patching these kind of issues.
Here’s a patch file that I already prepared: @react-native-community+datetimepicker+7.6.2.patch
In our projects we typically keep these in a
patches/
folder with aREADME.md
inside that documents each patch with a link to the related issue(s).I can really recommend this approach (much easier than having to fork as well).
The solution proposed by @sbeigel was indeed correct, but I kept getting an error at line 4 about “an expected expression”. Turns out some weird whitespace character was used, I don’t know if that was my fault or what…
EDIT: thanks to @phicoder for the suggestion (my bad for being kinda hasty), the issue was indeed on my end; after reinstalling and rebuilding this is the working patch.
But i did notice when running eas build locally im getting this issue.
So I changed back to
YGNodeRef
and it works.Updated package to
"@react-native-community/datetimepicker": "7.6.3",
and it fixed the issue for me, thanks!Same for me
Please fix.
This change breaks RN 0.71. When i changed back to
YGNodeRef
it was able to build with Xcode 15.3Got the same issue on Expo
Lol. it worked
@bitcrumb nice! EAS build servers are still working because they are not using Xcode 15.3, but we may have to do this if they upgrade. Thanks for sharing this pearl.
Upgraded to 7.6.4.
Now it’s vice versa 😅 🤡
incompatible function pointer types passing 'YGSize (YGNodeConstRef, float, YGMeasureMode, float, YGMeasureMode)' (aka 'struct YGSize (const struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)') to parameter of type 'YGMeasureFunc' (aka 'struct YGSize (*)(struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)') [-Wincompatible-function-pointer-types]
Changing YGNodeConstRef back to YGNodeRef fixed the problem.
v7.6.3 only applies to RN 0.73
It might be a good idea to consider this a breaking change. Starting a version support table on the README.md might be a good first issue for someone to pick up
I think you need to create a patch from the package. Because otherwise ‘’‘eas build’‘’ just pulls the current package from npm. https://medium.com/@PreetamGahlot/implement-patch-packages-in-react-native-mobile-app-61f651a7dec1
It 's same issue.
Issue still exists:
Confirm upgrading to 7.6.3 fixed it. Cheers 🍻
Works on Expo!! (although
expo-doctor@1.5.0
is yelling )Hello, I’m looking for companies or individuals willing to help with the maintenance: https://github.com/react-native-datetimepicker/datetimepicker/pull/868#issuecomment-2003591984
@david98 for me the proposed solution by @sbeigel was sufficient. I think the error at line 4 might have been on your end. Try to reinstall the package, implement the suggested solution and build again to avoid any confusion.