Getting Weird Error from Facebook.initializeAsync()

I’m getting this error when I try to run Facebook.initializeAsync() on my Android Expo Go client (no issue on the iPhone Expo Go client).

I call Facebook.initializeAsync() near the top of my app.js file.

I am on Expo 41.0.0 and I am using expo-facebook version 11.0.5 . I’ve gone through the configuration steps here and added all the requisite information from my Facebook app into my app.json file.

Anyone know how I might resolve this?

[Unhandled promise rejection: Error: Encountered an exception while calling native method: Exception occurred while executing exported method initializeAsync on module ExponentFacebook: Attempt to invoke interface method 'java.lang.String' on a null object reference]
at node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:103:50 in promiseMethodWrapper
at node_modules\@unimodules\react-native-adapter\build\NativeModulesProxy.native.js:15:23 in
at node_modules\expo-facebook\build\Facebook.js:128:10 in initializeAsync
at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
at node_modules\regenerator-runtime\runtime.js:293:29 in invoke
at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
at node_modules\regenerator-runtime\runtime.js:154:27 in invoke
at node_modules\regenerator-runtime\runtime.js:189:16 in PromiseImpl$argument_0
at node_modules\react-native\node_modules\promise\setimmediate\core.js:45:6 in tryCallTwo
at node_modules\react-native\node_modules\promise\setimmediate\core.js:200:22 in doResolve
at node_modules\react-native\node_modules\promise\setimmediate\core.js:66:11 in Promise
at node_modules\regenerator-runtime\runtime.js:188:15 in callInvokeWithMethodAndArg
at node_modules\regenerator-runtime\runtime.js:211:38 in enqueue
at node_modules\regenerator-runtime\runtime.js:238:8 in exports.async
at node_modules\expo-facebook\build\Facebook.js:115:7 in initializeAsync
at App.js:42:0 in <global>
at node_modules\metro\src\lib\polyfills\require.js:321:11 in loadModuleImplementation
at node_modules\expo\AppEntry.js:3:0 in <global>
at node_modules\metro\src\lib\polyfills\require.js:321:11 in loadModuleImplementation
at node_modules\metro\src\lib\polyfills\require.js:201:44 in guardedLoadModule
at app\screens\Settings\AboutScreen.js:30:58 in AboutScreen

please share a reproducible example

I had the same problem, I resolved it providing the appId got from the facebook developer console:
the final result should look like that:

    await Facebook.initializeAsync({
      appId: [YOUR_APP_ID],

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.