Upgrading from 2.3.1 to 2.4 I get Exception Android.Util.AndroidRuntimeException: Calling startActivity() from outside

Hi There,

When I upgraded from v2.3.1 of the .Net nuget package for Xamarin to ver 2.4 I get an exception “Android.Util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?” when calling LoginAsync

  • Which SDK does this apply to? “Auth0.OidcClient.Android”

  • Which verison of the SDK you are using? 2.4

  • Which version of the platform are you facing this error on? .Net, Xamarin 3.6 - 4.0

  • Was this code working before? Have you made any changes in the dashboard recently? Works fine on build 2.3.1 of the SDK

  • Please capture and attach the stacktrace, it helps a lot!

     0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal	C#
     0x1 in System.Diagnostics.Debugger.Mono_UnhandledException at /Users/builder/jenkins/workspace/xamarin-android-d16-1/xamarin-android/external/mono/mcs/class/corlib/System.Diagnostics/Debugger.cs:122,4	C#
     0x20 in Android.Runtime.DynamicMethodNameCounter.50	C#
     0x12 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw at /Users/builder/jenkins/workspace/xamarin-android-d16-1/xamarin-android/external/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:155,13	C#
     0x6 in System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0 at /Users/builder/jenkins/workspace/xamarin-android-d16-1/xamarin-android/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1023,49	C#
     0xC in Android.App.SyncContext. at /Users/builder/jenkins/workspace/monodroid-multibranch_d16-1/monodroid/external/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:35,19	C#
     0xE in Java.Lang.Thread.RunnableImplementor.Run at /Users/builder/jenkins/workspace/monodroid-multibranch_d16-1/monodroid/external/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36,6	C#
     0xA in Java.Lang.IRunnableInvoker.n_Run at /Users/builder/jenkins/workspace/monodroid-multibranch_d16-1/monodroid/external/xamarin-android/src/Mono.Android/obj/Release/android-28/mcw/Java.Lang.IRunnable.cs:81,4	C#
     0x11 in Android.Runtime.DynamicMethodNameCounter.50	C#
    
  • Please share the code that is causing the error.
    Auth0Client.LoginAsync(new { audience = AuthenticationConfig.Audience })

I’m also having this problem.

I’m also having this problem.

Works on Android 8.1. But doesn’t work on 9.0, 6.0 etc.

Please do the needful.

Also getting the same. Downgrading from 2.4 to 2.3.1 sorted it for now, but this isn’t a long term solution. The 2.4 package worked on 8.1 (Oreo), but not 9.0 (Pie).

Hey there everyone!

Sorry I must have missed it! Could one of you open a GitHub issue in the SDK repo and post the link here so I can ping the repo maintainers to take a look at that and help you with the struggle? Thank you!

1 Like

This is also a problem for us. Please fix ASAP.

Here’s the link to the Github issue.

1 Like

Thank you for opening it! I’ll relay it to appropriate team to look at it!