react-native link issue after upgrade to react-native-fbsdk 0.6.1

Created on 19 Jun 2017  路  16Comments  路  Source: facebook/react-native

Description

Running react-native link after upgrading to react-native-fbsdk 0.6.1 throws error:

[...]
rnpm-install info Linking react-native-fbsdk ios dependency
rnpm-install ERR! 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.

Reproduction Steps

Install react-native-fbsdk 0.6.1, remove node_modules and reinstall packages, then run react-native link

Additional Information

  • React Native version: "react": "16.0.0-alpha.12", "react-native": "0.45.1",
  • Platform: both
  • Development Operating System: MacOS
  • Build tools: Xcode Version 8.3.2 (8E2002),
    Android Studio 2.3.2 (AI-162.3934792), JRE 1.8.0_112-release-b06 x86_64
Stale

Most helpful comment

This is not a bug in react-native - it's a really old known issue with CocoaPods and latest react-native-fbsdk commits trigger it by using more modern project.pbxproj format.
I think there's no reason to track it in the RN repository as the root cause and possible workarounds are isolated inside either cocoapods or rnfbsdk.

react-native install react-native-fbsdk would fail. Best clean up / recovery I use is:

  1. react-native unlink react-native-fbsdk to clean up any previously failed link attempts.
  2. yarn add react-native-fbsdk
  3. open node_modules/react-native-fbsdk/ios/ios.xcodeproj/ - this launches XCode
  4. in XCode click on PROJECT ios.
  5. Make sure Project Format is set to "Xcode 3.2-compatible" in the rightmost panel
  6. Change "Use Release for command-line builds" to "Debug" and then back to "Release". this will force Xcode to save project.pbxproj in the old format.
  7. run less node_modules/react-native-fbsdk/ios/ios.xcodeproj/project.pbxproj to make sure the file is no longer XML.
  8. react-native link react-native-fbsdk

All 16 comments

Indeed it works fine with version 0.6.0 . The issue I raised comes with version 0.6.1, and btw, none of the proposed solutions in your link work for 0.6.1

@koenpunt made a pull request to fix this problem:
https://github.com/facebook/react-native-fbsdk/pull/349

This is not a bug in react-native - it's a really old known issue with CocoaPods and latest react-native-fbsdk commits trigger it by using more modern project.pbxproj format.
I think there's no reason to track it in the RN repository as the root cause and possible workarounds are isolated inside either cocoapods or rnfbsdk.

react-native install react-native-fbsdk would fail. Best clean up / recovery I use is:

  1. react-native unlink react-native-fbsdk to clean up any previously failed link attempts.
  2. yarn add react-native-fbsdk
  3. open node_modules/react-native-fbsdk/ios/ios.xcodeproj/ - this launches XCode
  4. in XCode click on PROJECT ios.
  5. Make sure Project Format is set to "Xcode 3.2-compatible" in the rightmost panel
  6. Change "Use Release for command-line builds" to "Debug" and then back to "Release". this will force Xcode to save project.pbxproj in the old format.
  7. run less node_modules/react-native-fbsdk/ios/ios.xcodeproj/project.pbxproj to make sure the file is no longer XML.
  8. react-native link react-native-fbsdk

@paulftw where is that "Use Release for command-line builds" Xcode setting located at?

@atom-r here's a screenshot
ios_xcodeproj

@paulftw Thanks! it worked!

@paulftw hey it worked but after I installed yarn and did what you said I ran npm install to install another package and it removed all my node_modules and the application is not running anymore =// what causes this, do you know it?

@paulftw it worked for me too. Thanks!!!!

@paulftw you're awesome!

@barakoles when npm or yarn rewrite or remove node_modules you have to convert .pbxproj to old format again, as per the steps I've provided above. But overall it's a hack, not a proper permanent fix, so projects will keep breaking again and again until rn-fbsdk get their act together (or cocoapods for that matter)

Many people have asked them to do that here: https://github.com/facebook/react-native-fbsdk/pull/349

@paulftw that really helped thanks!!!

paulftw's comment (July 17) solved this for me. It's unbelievable that the Facebook integration for a facebook-originated project (react native) is in this state. One would think facebook's highest priority would be making sure integration of their framework/services was functional.

I would also like to note that not all mobile developers have mac (with Xcode). For example, in order to develop applications for android enough to have a linux PC. Nevertheless, this error breaks their library linking.

It may help someone to know they need to click the standard editor icon in the right panel.
screen shot 2017-09-24 at 7 47 34 pm

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings