oblador/react-native-vector-icons

node not found in path during Copy Fonts phase

joprice opened this issue · 5 comments

Environment

  • os: OSX
  • target: iOS/android
  • version: @react-native-vector-icons/common@11.0.0-alpha.2

Description

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

node: command not found

node \"${PODS_TARGET_SRCROOT}/lib/commonjs/scripts/getFonts.js\" \"$PROJECT_ROOT\"/package.json > \"$RESOURCES_TO_COPY\"

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

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.

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)

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

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

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