Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 326
Pimmesz Avatar asked Dec 10 '25 12:12

Pimmesz


1 Answers

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

like image 54
hong developer Avatar answered Dec 12 '25 08:12

hong developer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!