smartcar / android-sdk

Smartcar Android Auth SDK
https://smartcar.github.io/android-sdk
MIT License
19 stars 2 forks source link

The auth webview doesn't get destroyed and is freezing after the auth flow is finished #21

Closed sergiupuhalschi closed 3 years ago

sergiupuhalschi commented 5 years ago

Hi,

After the authentication is completed, the WebView freezes and it doesn't return back to the calling activity. I believe the problem is at line 65 in com.smartcar.sdk.WebViewActivity.java: webView.destroy();

The web view crashes with this message:

WebView.destroy() called while WebView is still attached to window.
Application attempted to call on a destroyed WebView
    java.lang.Throwable
        at org.chromium.android_webview.AwContents.a(PG:355)
        at org.chromium.android_webview.AwContents.r(PG:636)
        at aIE.loadingStateChanged(PG:135)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:326)
        at android.os.Looper.loop(Looper.java:160)
        at android.app.ActivityThread.main(ActivityThread.java:6898)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Thanks.

gurpreetatwal commented 5 years ago

Hi @sergiupuhalschi! :wave:

Could you try updating to the latest version of the SDK (v3.0.0)? We switched the implementation to rely on custom tabs instead of using a WebView.

gurpreetatwal commented 3 years ago

Closing due to inactivity