Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for incompatible function pointer types passing 'YGSize' #905

Closed
yagnesh97 opened this issue Jun 5, 2024 · 12 comments
Closed

Fix for incompatible function pointer types passing 'YGSize' #905

yagnesh97 opened this issue Jun 5, 2024 · 12 comments

Comments

@yagnesh97
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @react-native-community/[email protected] for the project I'm working on.

Error:

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)')

Here is the diff that solved my problem:

diff --git a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m
index c139440..4ff3362 100644
--- a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m
+++ b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m
@@ -41,7 +41,7 @@ - (void)setTimeZoneName:(NSString *)timeZoneName {
   YGNodeMarkDirty(self.yogaNode);
 }
 
-static YGSize RNDateTimePickerShadowViewMeasure(YGNodeRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
+static YGSize RNDateTimePickerShadowViewMeasure(YGNodeConstRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
 {
   RNDateTimePickerShadowView *shadowPickerView = (__bridge RNDateTimePickerShadowView *)YGNodeGetContext(node);
 

This issue body was partially generated by patch-package.

@JoshBarnesD
Copy link
Collaborator

Hi yagnesh97!

This issue seems to have already been fixed in the v.7.6.3 release. Are you able to upgrade to the latest release (or at the very least v7.6.3)?

@sachinmishra365
Copy link

@JoshBarnesD its not working with latest (8.1.0). i have update my xcode 15.3 to 15.4 after that this issue is occurred.

@sachinmishra365
Copy link

Screenshot 2024-06-05 at 4 02 22 PM

@ChristianEasi
Copy link

ChristianEasi commented Jun 11, 2024

I can confirm that this issue happens with Xcode 15.4 and RNDateTimePicker (8.1.0) as shown in this comment. It seems that the applied patch needs to be reverted again.

@yagnesh97
Copy link
Author

@JoshBarnesD its not working with latest (8.1.0). i have update my xcode 15.3 to 15.4 after that this issue is occurred.

It is not working for me.

@Ruchita-Work
Copy link

I have the same issue

@KubilayKartega
Copy link

This issiue is still active with Xcode 15.4 and datetimepicker 8.1.1 prevents IOS build or run

@YanceyChan
Copy link

I have the same issue

@KubilayKartega
Copy link

I have the same issue

I downgraded Xcode to 15.2 it seems this is the only solution for now

@CMLCNL
Copy link

CMLCNL commented Aug 20, 2024

same issue. getting from xcode 15.4.

@RaguRam1991
Copy link

RaguRam1991 commented Aug 30, 2024

this worked for me

https://stackoverflow.com/a/78418925/10317833

@vonovak
Copy link
Member

vonovak commented Sep 30, 2024

Hello and thanks for asking,
you're having this error because you're running an incompatible version. see https://github.com/react-native-datetimepicker/datetimepicker#react-native-support
Thank you 🙂

@vonovak vonovak closed this as completed Sep 30, 2024
@react-native-datetimepicker react-native-datetimepicker locked and limited conversation to collaborators Sep 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants