Skip to content

"react-native link" error #13461

Closed
Closed
@EgaSetya

Description

@EgaSetya

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?

Activity

st0ffern

st0ffern commented on Apr 12, 2017

@st0ffern

what libs are you linking? and please provide full error log

Fantasim

Fantasim commented on Apr 12, 2017

@Fantasim

Hi,

I got the same error ! and i cannot open my xcode project now.

Kureev

Kureev commented on Apr 12, 2017

@Kureev
Contributor

I got the same error ! and i cannot open my xcode project now.

@Fantasim you can always use git checkout -- <yourproj>.xcodeproj to reset this change.

@EgaSetya @Fantasim Can you provide us a name of the library that causes this issue? Without it, we can't do anything.

naoey

naoey commented on Apr 12, 2017

@naoey

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.

st0ffern

st0ffern commented on Apr 12, 2017

@st0ffern

As @Kureev said, please provide the name of the library you use and full log.
right now it looks like there is a problem with the library you are linking itself and not react-native.

Until we see what library or error this is we can not do anything.

naoey

naoey commented on Apr 13, 2017

@naoey

It's not specific to any library. I deleted the libs one by one to confirm this and the problem still occured.

As I said, it seems to be purely because of the corrupt .xcodeproj file. Android modules were still linking fine, it failed on the first iOS module in the alphabetical order of installed libs. Restoring the .xcodeproj to the last non-corrupt version fixed it with the same set of installed libs.

EgaSetya

EgaSetya commented on Apr 13, 2017

@EgaSetya
Author

@Stoffern @Kureev Where can I find full error log? I only got 2 line of error when running "react-native link" on terminal

@naoey I tried running "git checkout -- myproject.xcodeproj" and got this error error: pathspec 'Pictalogi.xcodeproj' did not match any file(s) known to git.

naoey

naoey commented on Apr 13, 2017

@naoey

You need to give the full path, which will be ios/Pictalogi.xcodeproj

If you've already committed the corrupt file you need to specify a previous commit revision when checking out.

EgaSetya

EgaSetya commented on Apr 13, 2017

@EgaSetya
Author

@naoey I haven't committed the file yet and I already try as you suggested but it caused the same error.

Kureev

Kureev commented on Apr 14, 2017

@Kureev
Contributor

Can you share the diff of corrupted file so we can check where react-native link corrupts it?

I'm very sorry for this experience. I didn't experience this issue so far, so I need your assistance in order to fix it fast and efficiently. Please, be patient. Once we have a diff, we can find the right spot in the code that breaks it out.

dillonykyang

dillonykyang commented on Apr 17, 2017

@dillonykyang

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";

EgaSetya

EgaSetya commented on Apr 19, 2017

@EgaSetya
Author

@Kureev @Stoffern I got so many line diff on my project.pbxproj(link to file). Do I have to fix this manually?

ncuillery

ncuillery commented on Apr 19, 2017

@ncuillery
Contributor

@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.

ncuillery

ncuillery commented on Apr 19, 2017

@ncuillery
Contributor

@EgaSetya Yes, you do. You'll find some useful information in this thread #12261, starting from this post: #12261 (comment)

30 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @brianjlandau@hramos@pentarex@st0ffern@sibelius

        Issue actions

          "react-native link" error · Issue #13461 · facebook/react-native