简体   繁体   中英

Facebook Sdk crash Webview login

I am using the Facebook Sdk 4.1.0 as dependency in my app. To do login, I follow this instructions: Can't get location and email using Facebook API

And login works fine if the Facebook apps is installed in the device but if the Facebook app is not installed (login goes throw a webview created by facebook) then my app crash if the user click on the button login inside the webview:

在此处输入图片说明

And if the user press de Log in button the app crash inmediatly:

android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application at android.view.ViewRootImpl.setView(ViewRootImpl.java:559) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:269) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) at android.app.Dialog.show(Dialog.java:289) at android.app.AlertDialog$Builder.show(AlertDialog.java:951) at com.android.webview.chromium.WebViewContentsClientAdapter.onSavePassword(WebViewContentsClientAdapter.java:752) at com.android.org.chromium.android_webview.AwContentsClientCallbackHelper$1.handleMessage(AwContentsClientCallbackHelper.java:157) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5271) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteI nit.java:851) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:667) at dalvik.system.NativeStart.main(Native Method)

I changed the Facebook Sdk to 4.0 instead of 4.1 and now is working. Unbelievable.

您所传递的权限存在问题,您必须调试代码,然后才能更改权限请求来对其进行测试...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM