question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`react-native link` corrupts `project.pbxproj` file

See original GitHub issue

Description

Starting from a working project, recently upgraded to React Native 0.42.0. Following the instructions at https://developers.facebook.com/docs/react-native/getting-started

$ react-native install react-native-fbsdk
Scanning 646 folders for symlinks in /Users/dylan/dev/cala/ios/node_modules (6ms)
calaRN@1.2.68 /Users/dylan/dev/cala/ios
└── react-native-fbsdk@0.5.0

Scanning 647 folders for symlinks in /Users/dylan/dev/cala/ios/node_modules (5ms)
rnpm-install info Linking react-native-fbsdk ios dependency
rnpm-install info iOS module react-native-fbsdk has been successfully linked
rnpm-install info Module react-native-fbsdk has been successfully installed & linked
$ react-native link react-native-fbsdk
Scanning 647 folders for symlinks in /Users/dylan/dev/cala/ios/node_modules (6ms)
rnpm-install ERR! It seems something went wrong while linking. Error: Expected "/*" or ";" but "\"" found.
Please file an issue here: https://github.com/facebook/react-native/issues

Expected "/*" or ";" but "\"" found.
$ open ios/calaRN.xcodeproj

$ git diff ios/calaRN.xcodeproj/project.pbxproj

https://gist.github.com/dylanpyle/144e98578227c72287a119d386fb1bee

Reproduction

Can provide access to the project in question to the React Native team if needed; email me.

Additional Information

  • React Native version: 0.42.0
  • Platform: iOS
  • Operating System: macOS 10.12.3
  • Dev tools: XCode 8.2.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dylanpylecommented, Mar 15, 2017

Temporary workaround — manually editing the pbxproj file by hand as follows seems to fix it. This is, I assume, what react-native link should have been doing.

@@ -1003,7 +1040,10 @@
                                CURRENT_PROJECT_VERSION = 68;
                                DEAD_CODE_STRIPPING = NO;
                                DEVELOPMENT_TEAM = 5492JZ4B5H;
-                               HEADER_SEARCH_PATHS = "$(inherited)";
+                               HEADER_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "$(SRCROOT)/../node_modules/react-native-fbsdk/ios/RCTFBSDK/**",
+                               );
                                INFOPLIST_FILE = calaRN/Info.plist;
                                LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
                                LIBRARY_SEARCH_PATHS = (
@@ -1033,7 +1073,10 @@
                                "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
                                CURRENT_PROJECT_VERSION = 68;
                                DEVELOPMENT_TEAM = 5492JZ4B5H;
-                               HEADER_SEARCH_PATHS = "$(inherited)";
+                               HEADER_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "$(SRCROOT)/../node_modules/react-native-fbsdk/ios/RCTFBSDK/**",
+                               );
                                INFOPLIST_FILE = calaRN/Info.plist;
                                LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
                                LIBRARY_SEARCH_PATHS = (
1reaction
Kureevcommented, Mar 15, 2017

Thanks for the issue, @dylanpyle!

Most likely, this happens because of incorrect assumption here. We assume that if we have HEADER_SEARCH_PATHS defined, then it is an array which is apparently not the case. We need to add a check if HEADER_SEARCH_PATHS is not an array and if so, wrap it into one.

Do you want to make a contribution? Otherwise I can fix it tomorrow

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native link does not find project.pbxproj file
So it doesn't find the file project.pbxproj, as it is looking at it from the wrong folder. What I have tried so far...
Read more >
project.pbxproj merge conflicts react native, merging xcode project ...
This is when you're likely to run into merge conflicts. The output of react-native-git-upgrade will tell you if there were conflicts and on...
Read more >
Recovering a deleted xcode project : r/iOSProgramming - Reddit
So I had project which I accidentally deleted a while ago but all I have left from it is the .xcodeproj file. Is...
Read more >
[Resolve]-Project Crashes After Rename - appsloveworld.com
In finder, right click on your .xcodeproject file and click on show package contents. · Then right click on your project.pbxproj and open...
Read more >
react native reanimated error - You.com | The search engine you ...
react-native link react-native -reanimated ... react-native-reanimated Missing File Error ... Since I am starting a new project there is no other files.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found