React-native-fbsdk: Native Module FBAccessToken tried to override FBAccessTokenModule

Created on 6 Aug 2019  路  4Comments  路  Source: facebook/react-native-fbsdk

馃悰 Bug Report

I'm trying to use Facebook login on my app, but when i try to run my application on Android i receive this message. When i go to my mainApplication.java to see if there is something duplicated, everything looks alright. By the way, on IOS it's working.

my config is
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-fbsdk": "^1.0.1",
"react-native-firebase": "~5.5.6"

Captura de Tela 2019-08-06 a虁s 17 34 19

@Override
    protected List<ReactPackage> getPackages() {
      @SuppressWarnings("UnnecessaryLocalVariable")
      List<ReactPackage> packages = new PackageList(this).getPackages();
      // Packages that cannot be autolinked yet can be added manually here, for example:
      // packages.add(new MyReactNativePackage());
      packages.add(new RNFirebaseNotificationsPackage());
      packages.add(new RNFirebaseMessagingPackage());
      packages.add(new FBSDKPackage());
      return packages;
    }

Most helpful comment

I think you need to remove the packages.add(FBSDKPackage) line. The package should work with autolinking and doesn鈥檛 need to be included manuallly.

All 4 comments

I think you need to remove the packages.add(FBSDKPackage) line. The package should work with autolinking and doesn鈥檛 need to be included manuallly.

@janicduplessis
Remove the packages.add(FBSDKPackage) line
Error
The sdk has not been initialized make sure to call facebooksdk.sdkinitialize

Had the same issue. had no duplicates in mainapplication file. Solved it by removing the packages.add(new FBSDKPackage()) line. just like @janicduplessis suggested because that module was already being returned by getPackages() method. That's why it was being added again.

Remove the packages.add(FBSDKPackage) line
Error
The sdk has not been initialized make sure to call facebooksdk.sdkinitialize

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peymancyb picture peymancyb  路  6Comments

chirag04 picture chirag04  路  4Comments

santilorenzo picture santilorenzo  路  3Comments

notlose picture notlose  路  5Comments

vladotg picture vladotg  路  5Comments