react-native-facebook-login: undefined is not an object (evaluating 'FBLoginManager.getCurrentToken')

I’m constantly getting the above mentioned error in my Android app, written with react-native.

I’ve tried this on several different devices, both with the same results.

I followed the instructions as mentioned in the Android readme file, but to no avail. The FBLogin simply isn’t working.

Here is the relevant code from my index.android.js: ` var {NativeModules} = require(‘react-native’); var FBLogin = require(‘react-native-facebook-login’); var FBLoginManager = NativeModules.FBLoginManager;

renderFacebookLogin() { return ( <View style={styles.container}> <FBLogin /> </View> ); } `

I have added all the dependencies to the files listed in the Android readme.

Any help with this issue is much appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

I forgot to mention that I fixed the issue.

Every time you add a new module, kill the JS server and run react-native run-android. That will recompile the project and will build all dependencies. The JS server will also be restarted.