Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native link react-native-fbsdk not working in Windows with Android Studio #17451

Closed
nicoara opened this issue Jan 4, 2018 · 9 comments
Closed
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@nicoara
Copy link

nicoara commented Jan 4, 2018

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: Windows 8.1
Node: 8.1.3
Yarn: 1.3.2
npm: 4.6.1
Watchman: Not Found
Xcode: N/A
Android Studio: Version 2.3.0.0 AI-162.3871768

Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.51.0 => 0.51.0

Target Platform: Windows, Android Studio 2.3.1

Steps to Reproduce

  1. react-native init demoapp1

  2. cd demoapp1

  3. react-native install react-native-fbsdk
    Scanning folders for symlinks in C:\Users\nicoara\Desktop\demoapp1\node_modules
    (42ms)
    rnpm-install info Module react-native-fbsdk has been successfully installed & li
    nked

  4. react-native link react-native-fbsdk
    Scanning folders for symlinks in C:\Users\nicoara\Desktop\demoapp1\node_modules
    (38ms)
    { Error: Cannot find module 'C:\Users\nicoara\Desktop\demoapp1\node_modules\reac
    t-native-fbsdk\package.json'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at getRNPMConfig (C:/Users/nicoara/Desktop/demoapp1/node_modules/react-nativ
    e/local-cli/core/index.js:52:3)
    at Object.getDependencyConfig (C:/Users/nicoara/Desktop/demoapp1/node_module
    s/react-native/local-cli/core/index.js:90:18)
    at deps.reduce (C:/Users/nicoara/Desktop/demoapp1/node_modules/react-native/
    local-cli/link/getDependencyConfig.js:9:24)
    at Array.reduce (native)
    at getDependencyConfig (C:/Users/nicoara/Desktop/demoapp1/node_modules/react
    -native/local-cli/link/getDependencyConfig.js:6:15)
    at Object.link (C:/Users/nicoara/Desktop/demoapp1/node_modules/react-native/
    local-cli/link/link.js:180:24) code: 'MODULE_NOT_FOUND' }

  5. When adding the following line in Android Studio in MainApplication.java: 'import com.facebook.FacebookSdk', Android Studio does not recognize FacebookSdk

Expected Behavior

Those are the exact steps from the official documentation at https://developers.facebook.com/docs/react-native/getting-started.
I expected to install the Facebook SDK. I want to do a login in a React Native project.

(Write what you thought would happen.)

Actual Behavior

The errors are above in steps 4 and 5

Reproducible Demo

https://www.dropbox.com/s/iy9ppsydw15h028/demoapp1.zip?dl=0

@nmerchant
Copy link

+1

Running into this when following the documentation exactly.

Windows 10
npm v3.8.6
node v6.0.0
react v16.2.0
react-native v0.52.0

@Duverney
Copy link

+1

Windows 10
npm v5.6.0
node v9.4.0
react v16.2.0
react-native v0.52.0

@nmerchant
Copy link

I was able to get around this by doing npm install react-native-fbsdk instead of react-native install react-native-fbsdk. It appears that react-native install doesn't actually do anything, despite the output indicating it was installed successfully...nothing is installed to the node_modules folder.

@xemasiv
Copy link

xemasiv commented Feb 9, 2018

My setup:

node 8.9.1
npm 5.6.0
react 16.0.0
react-native-0.50.4

Can confirm what @nmerchant said.

  • No entries in my package json.
  • Nothing too in my node_modules

Fixed with:

npm install react-native-fbsdk --save
react-native link

I also encountered react native Could not find com.android.support:appcompat-v7:27.0.2. on build.

The following links helped:

References:

For version locking your fbsdk if you modified it.

I'll update with notes later, time for dinner lmao.

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 24, 2018
@wmendes
Copy link

wmendes commented Mar 1, 2018

I am having this problem. Any development on this?

@NULL-SWEAT
Copy link

I'm on v0.55.3 and I can confirm that using react-native install react-native-fbsdk does NOT work.

@surenderRsingh
Copy link

+1 (v0.55.4)

@AfamO
Copy link

AfamO commented Jul 19, 2018

I am encountered the same error on
windows 10
node 8.11.1
npm 6.2.0
react 16.3.1
react-native-0.55.4.

However mine was fixed when I used npm install react-native-fbsdk instead of react-native install react-native-fbsdk

@facebook facebook locked as resolved and limited conversation to collaborators Feb 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

9 participants