Pimmesz
Pimmesz

Reputation: 575

Cannot find symbol import com.facebook.CallbackManager

Currently working on a react app which uses the Facebook SDK. It seems to brake on the import of com.facebook.CallbackManager with the following error:

/android/app/src/main/java/com/phonebook/theredcorner/MainApplication.java:5: error: cannot find symbol import com.facebook.CallbackManager;

I've tried many suggestions online but it all doesn't seem to work. Anyone recently got this error and knows how to solve it?

I'm importing it in my MainApplication.java as follows

package com.phonebook.theredcorner;

import android.app.Application;

import com.facebook.CallbackManager;
import com.facebook.FacebookSdk;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.facebook.appevents.AppEventsLogger;

Furthermore I've followed all steps on the Facebook getting started page to implement the Facebook SDK.

Upvotes: 3

Views: 3896

Answers (1)

hong developer
hong developer

Reputation: 13926

The Facebook SDK was published as an independent module to Maven. Include the dependency in the app/build.gradle file.

dependencies {
    // Facebook Core only (Analytics)
    implementation 'com.facebook.android:facebook-core:5.0.0'
}

You may also need to add the following to your project/build.gradle file.

buildscript {
    repositories {
        mavenCentral()
    }
}

If the error persists after installation, make sure the file is in the next path.

facebook-android-sdk/facebook-core/src/main/java/com/facebook/CallbackManager.java

Upvotes: 8

Related Questions