okta-sdk-appauth-android icon indicating copy to clipboard operation
okta-sdk-appauth-android copied to clipboard

android.app.ServiceConnectionLeaked

Open lamba92 opened this issue 7 years ago • 1 comments

Something red appears on my logcat when launching this:

val completionIntent = Intent(this@LoginActivity, MainActivity::class.java)
            val cancelIntent = Intent(this@LoginActivity, LoginActivity::class.java)
            cancelIntent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP

            mOktaAuth.login(this@LoginActivity,
                    PendingIntent.getActivity(this@LoginActivity, OKTA_REQUEST_CODE, completionIntent, 0),
                    PendingIntent.getActivity(this@LoginActivity, OKTA_REQUEST_CODE, cancelIntent, 0)

The authentication seems to work fine tho. Error:

02-20 17:08:47.153 7647-7647/it.projector.lamba.projector E/ActivityThread: Activity it.projector.lamba.projector.activities.LoginActivity has leaked ServiceConnection net.openid.appauth.browser.CustomTabManager$1@8c5b0a that was originally bound here
                                                                            android.app.ServiceConnectionLeaked: Activity it.projector.lamba.projector.activities.LoginActivity has leaked ServiceConnection net.openid.appauth.browser.CustomTabManager$1@8c5b0a that was originally bound here
                                                                                at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:1532)
                                                                                at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:1424)
                                                                                at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1605)
                                                                                at android.app.ContextImpl.bindService(ContextImpl.java:1557)
                                                                                at android.content.ContextWrapper.bindService(ContextWrapper.java:684)
                                                                                at android.support.customtabs.CustomTabsClient.bindCustomTabsService(CustomTabsClient.java:70)
                                                                                at net.openid.appauth.browser.CustomTabManager.bind(CustomTabManager.java:95)
                                                                                at net.openid.appauth.AuthorizationService.<init>(AuthorizationService.java:113)
                                                                                at net.openid.appauth.AuthorizationService.<init>(AuthorizationService.java:91)
                                                                                at com.okta.appauth.android.OktaAppAuth.createAuthorizationService(OktaAppAuth.java:549)
                                                                                at com.okta.appauth.android.OktaAppAuth.recreateAuthorizationService(OktaAppAuth.java:540)
                                                                                at com.okta.appauth.android.OktaAppAuth.doInit(OktaAppAuth.java:430)
                                                                                at com.okta.appauth.android.OktaAppAuth.access$000(OktaAppAuth.java:69)
                                                                                at com.okta.appauth.android.OktaAppAuth$1.run(OktaAppAuth.java:157)
                                                                                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
                                                                                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                                                                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                                                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                                                                at java.lang.Thread.run(Thread.java:764)

lamba92 avatar Feb 20 '18 17:02 lamba92

Hey @Lamba92! Thanks for raising this issue.

Seems like it might be related to this issue with AppAuth.

I'll try and take a deeper look into this next week to see if we're not handling a case properly.

jmelberg-okta avatar Feb 21 '18 16:02 jmelberg-okta