Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Sdk Has Not Been Initialized, Make sure to call FacebookSdk.sdkInitialize() first #241

Closed
play-station opened this issue May 1, 2022 · 7 comments

Comments

@play-station
Copy link

play-station commented May 1, 2022

🐛 Bug Report

When upgrading react-native-fbsdk-next from v7.3.3 to v8+ our iOS and Android app crashes on start
The Metro server reports:
"The Sdk Has Not Been Initialized, Make sure to call FacebookSdk.sdkInitialize() first "
I read that the method FacebookSdk.sdkInitialize() is deprecated and tried all the recommendations posted elsewhere but no success.

To Reproduce

Upgrade react-native-fbsdk-next from v7.3.3 to v8+

Expected Behavior

App runs normally

Environment

System:
OS: Windows 10 10.0.22000
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 9.45 GB / 39.81 GB
Binaries:
Node: 14.19.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.23.0-20200615.1913 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
System Images: android-25 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom_64, android-31 | Google Play Intel x86 Atom_64
Android NDK: Not Found Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
IDEs:
Android Studio: Not Found
Visual Studio: 16.10.31424.327 (Visual Studio Community 2019)
Languages:
Java: 15.0.1
Python: 3.10.2
npmPackages:
@react-native-community/cli: Not Found
react: ^17.0.2 => 17.0.2
react-native: ^0.67.4 => 0.67.4
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

@muja555
Copy link

muja555 commented May 1, 2022

I solved it by adding facebookSdkVersion = "13.1.0" in my myproject/android/build.gradle

buildscript {
    ext {
       ...
       facebookSdkVersion = "13.1.0"
  }
 }

@play-station
Copy link
Author

play-station commented May 1, 2022

thanks @muja555 your solution works for Android
any idea what would be the fix for iOS?

@mikehardy
Copy link
Collaborator

Have you investigated the logs? This looks like a duplicate of #236 / failure to read release notes / did not add client access token. Can you confirm you have added a client access token as mentioned in release notes? Can you watch Xcode console or adb logcat to find the actual error messages?

@mikehardy
Copy link
Collaborator

@Md-Mudassir47

Why ignore my question? Not a great way to access support 🤔 "I'm having a problem, please help, but I won't take action on the help provided" ?

Have you investigated the logs? This looks like a duplicate of #236 / failure to read release notes / did not add client access token. Can you confirm you have added a client access token as mentioned in release notes? Can you watch Xcode console or adb logcat to find the actual error messages?

@Md-Mudassir47
Copy link

@Md-Mudassir47

Why ignore my question? Not a great way to access support 🤔 "I'm having a problem, please help, but I won't take action on the help provided" ?

Have you investigated the logs? This looks like a duplicate of #236 / failure to read release notes / did not add client access token. Can you confirm you have added a client access token as mentioned in release notes? Can you watch Xcode console or adb logcat to find the actual error messages?

Apologies, Had not read the last message & thanks this helped me resolve the issue.

@mikehardy
Copy link
Collaborator

Great! Glad that worked. I'm going to close this as a duplicate of that one then since it seems like the same problem, and I'll pin that issue so it is more discoverable

@DiegoFawr
Copy link

I solved it by adding facebookSdkVersion = "13.1.0" in my myproject/android/build.gradle

buildscript {
    ext {
       ...
       facebookSdkVersion = "13.1.0"
  }
 }

Great!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants