react-native-responsive-screen icon indicating copy to clipboard operation
react-native-responsive-screen copied to clipboard

Cannot resolve symbol 'heightPercentageToDP'

Open amduffy19 opened this issue 4 years ago • 4 comments

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!

amduffy19 avatar Jan 15 '21 19:01 amduffy19

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.

ajimae avatar Feb 08 '21 00:02 ajimae

Why the react-native link ?

gregfenton avatar Feb 08 '21 04:02 gregfenton

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.

ajimae avatar Feb 08 '21 10:02 ajimae

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.

jcerone-boom avatar Mar 30 '22 21:03 jcerone-boom