'The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first react native

I know this was asked before, but none of the solutions seem to help. I'm using first time Facebook SDK in my application.

MainActivity.java:

package com.spade;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
  @Override
  protected String getMainComponentName() {
    return "spade";
  }
}

MainApplication.java

package com.spade;   
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import io.invertase.firebase.RNFirebasePackage;
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
import com.th3rdwave.safeareacontext.SafeAreaContextPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import com.oblador.vectoricons.VectorIconsPackage;
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
    
public class MainApplication extends Application implements ReactApplication {
 List<ReactPackage> packages = new PackageList(this).getPackages();
            new VectorIconsPackage();
            new RNFirebaseNotificationsPackage();
            new RNFirebaseMessagingPackage();

          return packages;
}

What I have done wrong out there ? I don't understand the issue as I was new in react native



Solution 1:[1]

In my case, I have to add a new hash key because I changed environment

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ONE FVCK1NG MINUTE