React-native-fbsdk: [Android] Native component for "RCTFBLoginButton" does not exist

Created on 19 Sep 2016  路  7Comments  路  Source: facebook/react-native-fbsdk

1) Create project, install fbsdk and start react server

react-native init app
npm install --save react-native-fbsdk
npm start

2) Configure android project per https://github.com/facebook/react-native-fbsdk#31-android-project

3) Configure facebook params and add login button per https://developers.facebook.com/docs/react-native/login

4) run android

react-native run-android

5)

screen shot 2016-09-19 at 2 27 53 am

react-native log-android
09-18 22:30:03.602  3684  3722 I ReactNativeJS: Running application "app" with appParams: 
...
09-19 01:04:10.196  8251  8286 W ReactNativeJS: Warning: Native component for "RCTFBLikeView" does not exist
09-19 01:04:10.197  8251  8286 W ReactNativeJS: Warning: Native component for "RCTFBLoginButton" does not exist
09-19 01:04:10.197  8251  8286 W ReactNativeJS: Warning: Native component for "RCTFBSendButton" does not exist
09-19 01:04:10.198  8251  8286 W ReactNativeJS: Warning: Native component for "RCTFBShareButton" does not exist

https://github.com/facebook/react-native-fbsdk/issues/126 is the same issue for iOS but the solution was platform specific. @Fandekasp also commented there about having the same issue with android.

Most helpful comment

Hello I am having the same issue, but there is no documentation.

All 7 comments

Hello I am having the same issue, but there is no documentation.

If you haven't used rnpm or react-native install react-native-fbsdk, you will need to add react-native-fbsdk to your gradle files:

// android/settings.gradle:

include ':app'
// ...
include ':react-native-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')

// android/app/build.gradle:

dependencies {
// ...
  compile project(':react-native-fbsdk')
  compile 'com.facebook.android:facebook-android-sdk:[4,5)'
}

Closing inactive issue

hey guys.
Have you managed to solve your issue?
I'm having the same issue

Yes @folivi, I had I started a new project and used and alternative library (a wrapper from this one) react-native-facebook-login. Personally, is much better because encapsulates all the libraries and sdk needed for the functionality. (https://github.com/magus/react-native-facebook-login )

Also, the documentation is much robust than the other one

Great @jasmo2
I also found out why I had the issue.
I had to implement the sdk stuff in MyApplication.java instead of MainApllication.java

Does rn-facebook-login retrieve the long-term accessToken or the short-term one?
Cheers

Do not know But if you find out let me know @folivi

Was this page helpful?
0 / 5 - 0 ratings