1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【React Native】react-native-fbsdk 導入時 エラー (android)

Posted at

「The SDK has not been initialized」エラー解決

SDKの初期化がされていませんというエラーです。

>環境

    "react-native-camera": "^0.13.0",
    "react-native-fbsdk": "^0.7.0",

initialized error.png

>エラー内容

The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
sdkInitialized
    Validate.java:143
<init>
    AppEventsLogger.java:950
<init>
    AppEventsLogger.java:940
newLogger
    AppEventsLogger.java:452
initialize
    FBAppEventsLoggerModule.java:117
doInitialize
    ModuleHolder.java:198
markInitializable
    ModuleHolder.java:86
notifyJSInstanceInitialized
    NativeModuleRegistry.java:125
run
    CatalystInstanceImpl.java:385
handleCallback
    Handler.java:751
dispatchMessage
    Handler.java:95
dispatchMessage
    MessageQueueThreadHandler.java:31
loop
    Looper.java:154
run
    MessageQueueThreadImpl.java:194
run
    Thread.java:761

>修正内容

下記を追加
FacebookSdk.sdkInitialize(getApplicationContext());

    public void onCreate() {
        super.onCreate();
        SoLoader.init(this, /* native exopackage */ false);
        FacebookSdk.sdkInitialize(getApplicationContext());  // <- 追加
    }

>参考URL

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?