React-native-fbsdk: Android: 'Cannot Find Symbol' & 'No suitable constructor' errors on compile

Created on 27 Jun 2019  路  10Comments  路  Source: facebook/react-native-fbsdk

馃悰 Bug Report

When compiling my app on Android (via react-native run-android) I get the following errors.
I have recently updated my project to run RN0.59.4 (previously 0.44.3) and have also updated to the latest FBSDK (v0.10.0). My .gradle and 'Main' .java files are all as per the setup documentation.

Side note: iOS side is all OK.

node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBLoginManagerModule.java:145: error: cannot find symbol
            loginManager.logIn(activity,
                        ^
  symbol:   method logIn(Activity,List<String>)
  location: variable loginManager of type LoginManager

node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBAppEventsLoggerModule.java:237: error: cannot find symbol
      AppEventsLogger.setUserData(
                     ^
  symbol:   method setUserData(String,String,String,String,String,String,String,String,String,String)
  location: class AppEventsLogger

node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBGraphRequestModule.java:155: error: no suitable constructor found for AccessToken(String,String,String,<null>,<null>,<null>,<null>,<null>,<null>,<null>)
            graphRequest.setAccessToken(new AccessToken(
                                        ^
    constructor AccessToken.AccessToken(String,String,String,Collection<String>,Collection<String>,AccessTokenSource,Date,Date) is not applicable
      (actual and formal argument lists differ in length)
    constructor AccessToken.AccessToken(Parcel) is not applicable
      (actual and formal argument lists differ in length)

node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBLoginButtonManager.java:70: error: cannot find symbol
        loginButton.setPermissions(Utility.reactArrayToStringList(publishPermissions));
                   ^
  symbol:   method setPermissions(List<String>)
  location: variable loginButton of type RCTLoginButton

_I'll stop there but there are more errors in the same vein_

To Reproduce

Install & link FBSDK to react-native 0.59.4 based project following guides.

Expected Behavior

App compiles and runs

Other Notes

I have deleted the fbsdk folder from node_modules and re-installed to no avail.

Environment

macOS Mojave 10.14.5
Android Studio 3.4.1
RN 0.59.4
React 16.8.3

All 10 comments

Did you manage to find an answer to this?

I have the same issue, with the same setup. Trying to update everything AndroidX at the same time, so I noticed issue #473. I previously had the nullable issue, after resolving this I arrived at this point.

I've tried master, 1.0.rc1-3 and the same issue occurs there. Not sure why it's pointing to login when it looks like it should be loginWith

@StuartMorris0 sorry no - I don't have an answer. I'm in a bit of a hole with the Android X thing as well to be honest which isn't necessarily a FBSDK issue.
I fix one thing and another crops up!

If I do get to the bottom of the issue(s) then I'll post anything relevant here. Slow progress at the moment though!

Ok, so I had a specific FacebookSdkVersion set in the app gradle set to 4.37.0. Removing that meant it would take the latest fb sdk which is 5.0+ now. That resolved my login() error, onto the next one...

Yeah....this issue is going to hit alot of people hard. I got as far as callbackmanager declaration stuff, a few steps past this....need to bump this issue.

im in a similar situation except im trying to avoid the androidx migration for now, and sitting on 59.9

@scgough i can get it to compile in version 0.8.0
but 0.10.1 and .0 both run into these same issues the OC has

Same here... I downgrade from latest version to 0.8.0

Any news?

Try to unlink the library and use manual linking. RN 0.60.X have auto linking feature.

I'm using RN 0.59

Same on RN 0.60.5

UPD.
Removed facebookSdkVersion = "4.38.1" from android/build.gradle and built successfully

Was this page helpful?
0 / 5 - 0 ratings