marudy / react-native-responsive-screen

Make React Native views responsive for all devices with the use of 2 simple methods
MIT License
1.55k stars 141 forks source link

Cannot resolve symbol 'heightPercentageToDP' #94

Open amduffy19 opened 3 years ago

amduffy19 commented 3 years ago

I'm using this library on Android with no problems, everything looks great and is responsive.

However, I'm trying to get it working on iOS and running into the errors "Cannot resolve symbol 'heightPercentageToDP'" and "Cannot resolve symbol 'widthPercentageToDP'" when I try to import these functions.

Screen Shot 2021-01-15 at 2 29 30 PM

This is not just an issue with WebStorm not finding the functions, because the result when I run the app is that there is no styling -- all the margins and paddings are 0, the width of my TextInputs is the full screen, etc.

Any ideas why this isn't working for iOS? Thank you!

ajimae commented 3 years ago

Hi @amduffy19

Try running rm -rf node_modules form the root of the project and then yarn install && react-native link I believe this should solve your issues.

If it doesn't then kindly let us know.

gregfenton commented 3 years ago

Why the react-native link ?

ajimae commented 3 years ago

Why the react-native link ?

To link any library he might reinstalled using the later command above, I would also like to point out that the react-native link command is not compulsory though.

jcerone-boom commented 2 years ago

Since the problem is with iOS, it might be worth trying to run cd ios && pod install && cd ... I find that if I've run rm -rf node_modules and yarn install and things aren't working, running pod install tends to fix things.