software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
5.85k stars 954 forks source link

v1.5.0 iOS build fails with RN 0.59 #816

Closed geraintwhite closed 3 years ago

geraintwhite commented 4 years ago
fatal error: 'React/RCTRootContentView.h' file not found

#import <React/RCTRootContentView.h>

v1.4.1 built fine with RN 0.59 but v1.5.0 fails in the Xcode build. It appears to be related to this PR updating the project to RN 0.61.

Perhaps you could do something like this for backwards compatibility?

#if __has_include(<React/RCTRootContentView.h>)
#import <React/RCTRootContentView.h>
#endif

...

    if ([parent isKindOfClass:[RCTRootView class]]) {
#if __has_include(<React/RCTRootContentView.h>)
        [((RCTRootContentView*)rootContentView).touchHandler cancel];
#else
        [(RCTRootView*)parent cancelTouches];
#endif
    }
rye commented 4 years ago

Same issue here on RN 0.60. The RCTRootContentView.h file seems to not be available on RN 0.60, so 1.5.0 was indeed a breaking change for iOS.

Cyberfolks commented 4 years ago

facing same issue on RN 0.59.0 & react-native-gesture-handler 1.5.0.... is there any issue with

nestedJSObject commented 4 years ago

I am having the same issue. I tried Product -> Clean Build Folder, but that did not help.

Cyberfolks commented 4 years ago

i resolve this issue by downgrading to 1.3. and now im not using cocoapods creating app without cocoapods.. if you need help please tell me send you details.

SimonTsh commented 4 years ago

how do you downgrade to 1.3? pls send me the details! thanks!

GunnarAK commented 4 years ago

Got the same error using 1.5.0 on RN 0.59.9

To temporarily downgrade put this in your package.json:

"react-native-gesture-handler": "~1.4.0",

And reinstall your dependencies

wanxchao commented 4 years ago

Got the same error using 1.5.0 on RN 0.59.9

To temporarily downgrade put this in your package.json:

"react-native-gesture-handler": "~1.4.0",

And reinstall your dependencies

Thank you. I can run normally after I change the version.

co-de commented 4 years ago

Same problem with RN 0.61.1.

mx-dever commented 4 years ago

resolved, thks @GunnarAK

rafalzawadzki commented 4 years ago

Got the same error using 1.5.0 on RN 0.59.9

To temporarily downgrade put this in your package.json:

"react-native-gesture-handler": "~1.4.0",

And reinstall your dependencies

1.4.0 & RN 0.59.9 do not work on Android due to androidx. Had to downgrade back to 1.1.3.

Ashutosh8127 commented 4 years ago

Replace #import <React/RCTRootContentView.h> with #import "RCTRootContentView.h"

Problem Resolved

snafx commented 4 years ago

Replace #import <React/RCTRootContentView.h> with #import "RCTRootContentView.h"

My RN project decided to stop working without any reason. Been stuck with this error since yesterday, tried many different things and thanks to yours it worked.

Thanks @Ashutosh8127 !!

RageCPP commented 4 years ago

Replace #import <React/RCTRootContentView.h> with #import "RCTRootContentView.h"

Problem Resolved

the problem was solved, thanks

hussainhspl commented 4 years ago

@Ashutosh8127 : Can you share path ?

hussainhspl commented 4 years ago

this stack overflow comment solved my Problem https://stackoverflow.com/a/58833342/11394425

herisusantuy commented 4 years ago

Replace #import <React/RCTRootContentView.h> with #import "RCTRootContentView.h"

Problem Resolved

thank youuu.....u save my day @Ashutosh8127

zulqarnain26 commented 4 years ago

thank u @Ashutosh8127

geraintwhite commented 4 years ago

Is this going to be fixed in the lib or do we have to stay on 1.4.x for RN < 0.60?

jianxinzhoutiti commented 4 years ago

+1

erwinwahyura commented 4 years ago

thanks @Ashutosh8127

kv1991 commented 4 years ago

的点点滴滴得到的

fabOnReact commented 4 years ago

Replace #import <React/RCTRootContentView.h> with #import "RCTRootContentView.h"

Problem Resolved

is there a more permanent fix?

KingAmo commented 4 years ago

Replace #import <React/RCTRootContentView.h> with #import "RCTRootContentView.h"

Problem Resolved

@kmagiera could this be solved to help people in react native 0.59 ?

kabaranak commented 4 years ago

i did Replace #import <React/RCTRootContentView.h> with #import "RCTRootContentView.h" then error: #import <React/RCTImageView.h> not found

version 1.5.2 & RN 0.59.9

mmarquezv commented 4 years ago

I have the same problem with ReactNative 0.59.8 and "react-native-gesture-handler": "1.2.1", ¿Does anyone going to merge @vovkind solution into main repo? ¿How can I have my own repository for npm artifacts?

johnlim5847 commented 4 years ago

Hi guys any update on this?

kmagiera commented 4 years ago

Hi everyone. Supporting 0.59 is not on a priority list for the maintainers at the moment. We'd be happy to merge necessary changes to keep it compatible if anyone is willing to contribute a fix. If there is one already that I am not aware of please let me know. I'll keep this issue open for the time being

cjcheshire commented 4 years ago

@kmagiera I have seen some libs doing something like this would this work?

#if __has_include(<React/RCTRootContentView.h> )
#import <React/RCTRootContentView.h> 
#else
#import "RCTRootContentView.h"
#endif

Appreciate the focus on 60+…

DeVoresyah commented 4 years ago

Replace #import <React/RCTRootContentView.h> with #import "RCTRootContentView.h"

Problem Resolved

afther doing that, I got this error #import <React/RCTImageView.h> not found

MRanka-oyo commented 4 years ago

Any solution for @DeVoresyah issue?

DeVoresyah commented 4 years ago

Any solution for @DeVoresyah issue?

yes I found it, I'm using Ignite Boilerplate and modify some config https://github.com/infinitered/ignite

bermann commented 4 years ago

@DeVoresyah can you give some details?

DeVoresyah commented 4 years ago

@DeVoresyah can you give some details?

you can clone this repo https://github.com/libscode/rn-alice I already make it stable based on Ignite CLI

fabellonnoe commented 4 years ago

In xcode change to "RCTRootContentView.h"

ableabhijeet commented 4 years ago

i did Replace #import <React/RCTRootContentView.h> with #import "RCTRootContentView.h" then error: #import <React/RCTImageView.h> not found

version 1.5.2 & RN 0.59.9 @kabaranak I am facing exact same issue. How did you resolve it?

hzz780 commented 4 years ago

If throw error: #import <React/RCTImageView.h> not found Find out the component which throw the error. For me, in the rubbish code, i found that the coder use rn 0.59 but use react-native-screens 2.x In docs of react-native-screens, https://www.npmjs.com/package/react-native-screens

Since version 2.0.0 react-native-screens requires RN v0.60+. Check 1.0.0-alpha for Expo support or older versions of React Native.
aemc commented 3 years ago

this is still an issue with 0.59...

bkhurjawal commented 2 years ago

Thank you @Ashutosh8127