react-native: "react-native link" error

I tried to run react-native link after running npm install, this was working fine before now I got this error ERR! It seems something went wrong while linking. Error: Expected "/* Begin ", "/* End ", "\"" or [A-Za-z0-9_.] but "<" found. Please file an issue here: https://github.com/facebook/react-native/issues

What causes this error?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 16
  • Comments: 35 (5 by maintainers)

Most upvoted comments

@dillonykyang I had a similar issue.

Before using the link command, change all the HEADER_SEARCH_PATHS that have a mono-string value

HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native-navigation/ios/**";

to a multi-string value:

HEADER_SEARCH_PATHS = (
  "$(SRCROOT)/../node_modules/react-native-navigation/ios/**",
);

The link command should work properly now.

Have you tried doing react-native upgrade before react-native link? That worked for me.

Make sure to git diff your *.pbxproj

In our case, there’s a lot of “conflicts”. So the Xcode can’t parse the project.

screen shot 2017-11-03 at 8 29 49 am

I Can’t Find HEADER_SEARCH_PATHS for android, Where is that?

Similar if not same issue here. My error message:

ERR! Something went wrong while linking. 
Error: Cannot read property 'nodeValue' of undefined 

multi-string value does not resolve thit issue

mac osx sierra:

    "react": "15.4.1",
    "react-native": "0.39.2",

This error seems to be related to Info.plist to me.

Steps to reproduce on my project:

  1. react-native link: FINE, but Info.plist was changed.
  2. react-native link: ERR! Something went wrong while linking. Error: Cannot read property ‘nodeValue’ of undefined
  3. I revert changes made to Info.plist
  4. react-native link: FINE, but Info.plist was changed again.
  5. react-native link: ERR! Something went wrong while linking. Error: Cannot read property ‘nodeValue’ of undefined

Environment: I tested this on Windows and Mac:

"react": "16.3.1", 
"react-native": "0.55.2",

Below are the changes made on my Info.plist when running react-native link: changes_infoplist

Edit:

I just realized this problem occurs when using/linking react-native-vector-icons. When I remove this dependency, the error disappears.

I had this same error too when installing 0.6.1. I reverted and installed 0.6.0 as was suggested and that worked. The HEADER_SEARCH_PATHS were already a multi-string value.

I have the issue with this library https://github.com/xinthink/react-native-material-kit

These lines (diff) are causing the error:


-				HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native-navigation/ios/**";
+				HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native-navigation/ios/**""$(SRCROOT)/../node_modules/react-native-material-kit/iOS/RCTMaterialKit";

Just encountered the same error. It seems to be caused by a corrupt .xcodeproj file because the linking fails on the first iOS module it encounters.

@Fantasim @EgaSetya we were able to fix it by checking out an older version of the .xcodeproj file that worked and then ran link again.