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.46k stars 2.13k forks source link

node not found in path during Copy Fonts phase #1673

Closed joprice closed 4 weeks ago

joprice commented 4 weeks ago

Environment

Description

The Copy Fonts phase of the build reference the node binary directly, resulting in the error

node: command not found

https://github.com/oblador/react-native-vector-icons/blob/ecbf0716ba2ea4b216bf4af812cee4cd5d2fbfbf/packages/common/react-native-vector-icons.podspec#L68

I'm new to react native, but it seems there is a convention to use NODE_BINARY to reference node in build scripts, which is exported by .xcode.env or .xcode.env.local.

https://github.com/facebook/react-native/blob/eddc0a1d490f14e5aea9a0e8ef47d212d318d662/packages/react-native/sdks/hermes-engine/hermes-engine.podspec#L84

joprice commented 4 weeks ago

I tried this change out locally and NODE_BINARY isn't passed to the script, so not sure how that's intended to be used.

joprice commented 4 weeks ago

I added "$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh" as in the hermes script which loads the xcode.env file and so now the NODE_BINARY be found. Unfortunately, I'm getting duplicate symbols errors now, but that may be unreateld, a side-effect of installing locally:

duplicate symbol '_OBJC_METACLASS_$_RCTModulesConformingToProtocolsProvider' in:
    [path-to-app]/react-native-vector-icons/libreact-native-vector-icons.a[7](RCTModulesConformingToProtocolsProvider.o)
    [path-to-app]/ReactCodegen/libReactCodegen.a[25](RCTModulesConformingToProtocolsProvider.o)
joprice commented 4 weeks ago

Those errors were due to relying on a locally version. I published it to github packages and it works with this change https://github.com/oblador/react-native-vector-icons/compare/monorepo...joprice:react-native-vector-icons:nodePath.

johnf commented 4 weeks ago

@joprice Thanks for testing and coming up with a solution, should be fixed in the latest alpha release

joprice commented 4 weeks ago

No problem! Great library. I'll report anything else I find in the alpha.