-
Notifications
You must be signed in to change notification settings - Fork 140
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
Crash when calling loginWithBrowser with targetSdk 34 in build.gradle #707
Comments
@dmichelutti can you share how the code is being called? |
Hi @poovamraj , I simply call the function like the example does. ` val builder = WebAuthProvider
This code will work propery as long as I put "targetSdk = 34" inside my build.gradle file. With this property the crash appears. |
Makes sense but from the error message, I wanted to know whether this is being called from an Activity or another component |
I'm calling that function from an Activity, a simple Activity with a Login button. |
Any news? This issue is blocking the release on Play Store, because now the targetSdk must be >= 33 |
@dmichelutti I am not able to reproduce this issue on our end. Can you reproduce this issue in our sample app and provide the fork here (without secrets) - https://github.com/auth0-samples/auth0-android-sample/tree/master/00-Login-Kt? |
Hi @poovamraj I think I have found the source of the problem. |
Checklist
Description
Targeting Android application to latest sdk (targetSdk = 34 inside defaultConfig in build.gradle) the application crashes at login with this stackTrace:
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? : android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? at android.app.ContextImpl.startActivity(ContextImpl.java:1127) at android.app.ContextImpl.startActivity(ContextImpl.java:1103) at android.content.ContextWrapper.startActivity(ContextWrapper.java:436) at com.auth0.android.provider.AuthenticationActivity$Companion.authenticateUsingBrowser$auth0_release(AuthenticationActivity.kt:120) at com.auth0.android.provider.OAuthManager.startAuthentication(OAuthManager.kt:67) at com.auth0.android.provider.WebAuthProvider$Builder.start(WebAuthProvider.kt:522)
For our solution I have deleted (temporary) targetSdk variable from build.gradle, but the application will show an annoying popup at the beginning, showing the application is done for oler versions of Android.
Reproduction
1 - Start an application with Auth0 library WITHOUT targetSdk flag in build.gradle
2 - Call loginWithBrowser method and all will work fine
3 - Add targetSdk = 34 (also 33 will do the job) and refresh gradle
4 - Now calling loginWithBrowser method will crash
Additional context
No response
Auth0.Android version
2.10.2
Android version(s)
14
The text was updated successfully, but these errors were encountered: