-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird ActivityNotFoundException when logging in #166
Comments
Hi @merijndejonge This usually means your device doesn't have chrome installed. If it is then it might not be set as the default browser on your device. What device are you testing on? |
I'm running on an android-one device (Nokia 7 plus). So Chrome is definitely installed and is also the default browser. |
Hi @merijndejonge Are you starting the auth flow in the context of the autofill service? or in the context of the activity? I have not tried using the autofill service to start but if you are starting the flow in the autofill service then could the service have been disconnected? I'm guessing it can happen when autofill is complete. You can use the event log and see what your autofill service is doing by using |
Hi @FeiChen-okta,
This is according to the documentation https://developer.android.com/guide/topics/text/autofill-services?hl=en#kotlin
This signIn method will call the okta signing code:
So, everything runs in the MainActivity, right? |
Hi @merijndejonge When starting by hand are you also using the following? lifecycleScope.launch {
identityManager.signIn(this@MainActivity)
} My guess is that the val payload = AuthenticationPayload.Builder().build()
webAuth.registerCallback(webAuthCallBack(it), activity)
webAuth.signIn(activity, payload) |
Yes, I'm using the exact same code. Anyway, I removed the coroutine code and replaced it with the normal callback way of working. Then I fixed a couple of other issues, it seems to work now. But it all feels a bit fragile. I had a hard time to get everything to work including logout->login flow. Thanks for your help! |
Unfortunately, the problem still exists. I've completely rewritten the code for authentication. But the same error occurs. I'm nog using adb as you suggested. before the crash, and before all the okta stuff is happening such as OktaRedirectActivity, I see the following line:
Then a lot of (okta) stuff happens but this chrome activity is not resumed. Then, the app crashes:
`myapp.app' is my app. Any idea what is going on, and how to solve this? |
Hi @merijndejonge From the logs it looks like chrome has started and stopped. This might be due to an invalid uri. How are you passing in the |
Hi @FeiChen-okta ,
If you wish, I can give you a stripped-down version of my app that demonstrates the issue. |
Hi @FeiChen-okta I have the same issue in my project. Environment
|
Hello @bedirguven, Can you tell me a little more about the device on which you see this issue? Can you confirm that Chrome is installed? Thanks |
Hi @bedirguven Have you set taskAffinity property in AndroidManifest.xml of your project? P.S.: try to assembly library from this PR #175 Thanks |
Can anyone still reproduce this with the latest SDK? |
any update on this? Same issue here. all crashes happening with Galaxy devices. Okta version 1.0.16 |
@lucianoeli react-native users had similar problem okta/okta-react-native#81, you can try using browser matchAll flag when using WebAuthBuilder |
thanks for the response. i try that but i´m still getting the crash :/ |
Seems related to https://github.com/okta/okta-oidc-android/issues?q=is%3Aissue+https%3A%2F%2Fgit.luolix.top%2Fopenid%2FAppAuth-Android%2Fissues%2F157 Were any considerations made in the new okta-oidc-android library as it replaced the old appauth-android library, where the appauth-android library had addressed Samsung SBrowser related issues? |
Hi everyone, |
Hi @redaAazNJ run this command to see if the deice show any app that supports chrome custom tabs
If you have a chrome custom tab enabled browser installed it should show:
|
Hi @FeiChen-okta, Thank you for your answer. In addition theses crashes are not systematic. The user may or may not experience this issue without changing the device. |
Hi @redaAazNJ Is that device managed? If it is then chrome has to be installed on the work profile same as the app using the SDK. |
Hi @redaAazNJ, do you have any updates for us? |
Hi everyone, But as I said, this crash doesn't appear all the time, If it was related to chrome installation it should never show the login page, right? |
Hu,
I'm using okta client on android for oidc authentication. I'm integrating the authentication flow in an autofill service. The authflow is triggered from the Minaactivity of my app.
The app implements to autofill API of Android.
When the MainActivity that triggers the authentication flow is started from within the autofill service I get the following exception:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW pkg=com.android.chrome (has extras) } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2057) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1711) at android.app.Activity.startActivityForResult(Activity.java:5192) at android.app.Activity.startActivityForResult(Activity.java:5150) at android.app.Activity.startActivity(Activity.java:5521) at android.app.Activity.startActivity(Activity.java:5489) **at com.okta.oidc.OktaAuthenticationActivity$1.onCustomTabsServiceConnected(OktaAuthenticationActivity.java:275)** at androidx.browser.customtabs.CustomTabsServiceConnection.onServiceConnected(CustomTabsServiceConnection.java:57) at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1948) at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1980) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7397) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Apparently, something in onCustomTabsServiceConnected goes wrong. It seems that 'startActivity(createBrowserIntent(browserPackage, session));' in the method is causing the exception.
As I'm not an android expert, I've no clue what I'm doing wrong.
Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered: