question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FacebookSdk.sdkInitialize()

See original GitHub issue

Hi, I’m trying to use Facebook login on Android but It shows an error.

JS: Error in firebase.login: Error: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
JS:     com.facebook.internal.Validate.sdkInitialized(Validate.java:145)
JS:     com.facebook.login.LoginManager.<init>(LoginManager.java:68)
JS:     com.facebook.login.LoginManager.getInstance(LoginManager.java:79)
JS:     com.tns.Runtime.callJSMethodNative(Native Method)
JS:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:861)
JS:     com.tns.Runtime.callJSMethodImpl(Runtime.java:726)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:712)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:693)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:683)
JS:     com.tns.gen.android.view.GestureDetector_SimpleOnGestureListener_frnal_ts_helpers_l55_c38__TapAndDoubleTapGestureListener.onSingleTapUp(android.view.GestureDetector$SimpleOnGestureListener.java)
JS:     android.view.GestureDetector.onTouchEvent(GestureDetector.java:595)
JS:     android.support.v4.view.GestureDetectorCompat$GestureDetectorCompatImplJellybeanMr2.onTouchEvent(GestureDetectorCompat.java:475)
JS:     android.support.v4.view.GestureDetectorCompat.onTouchEvent(GestureDetectorCompat.java:538)
JS:     com.tns.Runtime.callJSMethodNative(Native Method)
JS:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:861)
JS:     com.tns.Runtime.callJSMethodImpl(Runtime.java:726)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:712)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:693)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:683)
JS:     com.tns.gen.android.view.View_OnTouchListener.onTouch(View_OnTouchListener.java:12)
JS:     android.view.View.dispatchTouchEvent(View.java:8582)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2482)
JS:     com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1798)
JS:     android.app.Dialog.dispatchTouchEvent(Dialog.java:778)
JS:     com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2443)
JS:     android.view.View.dispatchPointerEvent(View.java:8799)
JS:     android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4662)
JS:     android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4520)
JS:     android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4034)
JS:     android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4087)
JS:     android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4053)
JS:     android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4190)
JS:     android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4061)
JS:     android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4247)
JS:     android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4034)
JS:     android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4087)
JS:     android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4053)
JS:     android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4061)
JS:     android
JS: .view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4034)
JS:     android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6463)
JS:     android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6437)
JS:     android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6390)
JS:     android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6622)
JS:     android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
JS:     android.os.MessageQueue.nativePollOnce(Native Method)
JS:     android.os.MessageQueue.next(MessageQueue.java:148)
JS:     android.os.Looper.loop(Looper.java:151)
JS:     android.app.ActivityThread.main(ActivityThread.java:5643)
JS:     java.lang.reflect.Method.invoke(Native Method)
JS:     java.lang.reflect.Method.invoke(Method.java:372)
JS:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
JS:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
JS: Error: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
JS:     com.facebook.internal.Validate.sdkInitialized(Validate.java:145)
JS:     com.facebook.login.LoginManager.<init>(LoginManager.java:68)
JS:     com.facebook.login.LoginManager.getInstance(LoginManager.java:79)
JS:     com.tns.Runtime.callJSMethodNative(Native Method)
JS:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:861)
JS:     com.tns.Runtime.callJSMethodImpl(Runtime.java:726)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:712)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:693)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:683)
JS:     com.tns.gen.android.view.GestureDetector_SimpleOnGestureListener_frnal_ts_helpers_l55_c38__TapAndDoubleTapGestureListener.onSingleTapUp(android.view.GestureDetector$SimpleOnGestureListener.java)
JS:     android.view.GestureDetector.onTouchEvent(GestureDetector.java:595)
JS:     android.support.v4.view.GestureDetectorCompat$GestureDetectorCompatImplJellybeanMr2.onTouchEvent(GestureDetectorCompat.java:475)
JS:     android.support.v4.view.GestureDetectorCompat.onTouchEvent(GestureDetectorCompat.java:538)
JS:     com.tns.Runtime.callJSMethodNative(Native Method)
JS:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:861)
JS:     com.tns.Runtime.callJSMethodImpl(Runtime.java:726)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:712)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:693)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:683)
JS:     com.tns.gen.android.view.View_OnTouchListener.onTouch(View_OnTouchListener.java:12)
JS:     android.view.View.dispatchTouchEvent(View.java:8582)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2519)
JS:     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2171)
JS:     com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2482)
JS:     com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1798)
JS:     android.app.Dialog.dispatchTouchEvent(Dialog.java:778)
JS:     com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2443)
JS:     android.view.View.dispatchPointerEvent(View.java:8799)
JS:     android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4662)
JS:     android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4520)
JS:     android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4034)
JS:     android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4087)
JS:     android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4053)
JS:     android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4190)
JS:     android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4061)
JS:     android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4247)
JS:     android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4034)
JS:     android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4087)
JS:     android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4053)
JS:     android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4061)
JS:     android.view.ViewRootImpl$InputS
JS: tage.deliver(ViewRootImpl.java:4034)
JS:     android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6463)
JS:     android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6437)
JS:     android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6390)
JS:     android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6622)
JS:     android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
JS:     android.os.MessageQueue.nativePollOnce(Native Method)
JS:     android.os.MessageQueue.next(MessageQueue.java:148)
JS:     android.os.Looper.loop(Looper.java:151)
JS:     android.app.ActivityThread.main(ActivityThread.java:5643)
JS:     java.lang.reflect.Method.invoke(Native Method)
JS:     java.lang.reflect.Method.invoke(Method.java:372)
JS:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
JS:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Any idea? I already did all the files configuration and set up everything in Facebook. The only thing I’m not sure is the Key-hash because it doesn’t appear on my log. It just shows this error. Thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
t-moecommented, Aug 4, 2016

@PedroAnibarro1 Allright. Thanks for the feedback. @EddyVerbruggen We should think about delaying FbSdkInit somehow or add a note about where to place firebase.init.

1reaction
t-moecommented, Aug 4, 2016

Try to move it to another location. Maybe the AppComponent Constructor will work. Otherwise ngOnInit of your AppComponent.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FacebookSdk.sdkInitialize (Context) is deprecated
The Facebook SDK is now auto initialized on Application start. If you are using the Facebook SDK in the main process and don't...
Read more >
FacebookSdk - Meta for Developers
FacebookSdk(). public FacebookSdk(). Class Methods. sdkInitialize(Context, int). This function initializes the Facebook SDK, the behavior of Facebook SDK ...
Read more >
The Sdk Has Not Been Initialized, Make sure to call ... - GitHub
I read that the method FacebookSdk.sdkInitialize() is deprecated and tried all the recommendations posted elsewhere but no success. To Reproduce.
Read more >
com.facebook.FacebookSdk.sdkInitialize java code examples
Best Java code snippets using com.facebook.FacebookSdk.sdkInitialize (Showing top 20 results out of 315) · FacebookInitProvider.onCreate() · FBLoginSampleApp.
Read more >
com.facebook.FacebookSdk#sdkInitialize - ProgramCreek.com
private void setupFacebookStuff() { // This should normally be on your application class FacebookSdk.sdkInitialize(getApplicationContext()); mLoginManager ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found