oblador / react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
https://oblador.github.io/react-native-vector-icons/
MIT License
17.31k stars 2.12k forks source link

'React/RCTBridgeModule.h' file not found - 10.0.1 breaks with RN < 0.71.0 (0.70 is still officially supported) #1570

Closed Sunhat closed 6 months ago

Sunhat commented 7 months ago

Environment

macOS Sonoma 14.0 XCode 15.0.1 Target: iOS RN Vector Icons version: 10.0.2 React Native: 0.70.14

Description

/node_modules/react-native-vector-icons/RNVectorIconsManager/RNVectorIconsManager.h:9:9: 'React/RCTBridgeModule.h' file not found

import <React/RCTBridgeModule.h>

    ^~~~~~~~~~~~~~~~~~~

Duplicate of this closed ticket from 2017, as you can see, others recently are responding. https://github.com/oblador/react-native-vector-icons/issues/385 https://github.com/oblador/react-native-vector-icons/issues/380

Attempts to fix

Reproducible Demo

I can only imagine using the described versions above would re-produce. I don't appear to be alone here.

Sunhat commented 7 months ago

I found a likely cause of the problem. In React Native Vector Icons PR 1550, a commit was made to "[Bring podspec in line with [NEW ARCH]" https://github.com/oblador/react-native-vector-icons/pull/1550/files

This commit includes the use of a new method introduced in RN 0.72.0

https://github.com/facebook/react-native/blob/v0.72.0/packages/react-native/scripts/react_native_pods.rb

Therefore, this commit would be enough to warrant RN Vector Icons to have released v11.0.0

As this method controls New vs Old Arch deps, it's likely what's breaking builds with RN < 0.72.0

Please could you fix this in a 10.0.3 patch?... and if so desired, release 11.0.0

Thanks

nnmtesuji commented 7 months ago

@Sunhat is it fixed?

nnmtesuji commented 7 months ago

same problem here :(

fakingfantastic commented 7 months ago

Also experienced this issue. Confirmed that locking the package to version 10.0.0 fix it for me

Rassell commented 7 months ago

Also experienced this issue. Confirmed that locking the package to version 10.0.0 fix it for me

Same here... thanks for the quickfix!

Sunhat commented 7 months ago

@fakingfantastic @Rassell Yes, locking to 10.0.0 does fix, however, this version does have a memory leak

JaakkoKammonen commented 7 months ago

I have react-native 0.70.6 and the fix was to downgrade to version 9.2.0 of vector icons.

EDIT: In my package.json i had "react-native-vector-icons": "^10.0.0", and changed to "react-native-vector-icons": "10.0.0"

Sunhat commented 7 months ago

@JaakkoKammonen I am using 0.70.14 with 10.0.0 vector icons. I would recommend double checking this.

It may be in your package.json that you had "^10.0.0", the ^ will install the latest 10.0.x version, meaning 10.0.2.

Try specifically "react-native-vector-icons": "10.0.0" - otherwise I'm not sure, and thanks for commenting to help others

JaakkoKammonen commented 7 months ago

@Sunhat My bad... Thank you! I edited my last comment so others dont make the same mistake as i did.