auth0 / auth0-oidc-client-net

OIDC Client for .NET Desktop and Mobile applications
https://auth0.github.io/auth0-oidc-client-net/
Apache License 2.0
84 stars 49 forks source link

Error processing method: 'System.Void Auth0.OidcClient.Auth0ClientBase/<RefreshTokenAsync> #249

Closed saamerm closed 1 year ago

saamerm commented 1 year ago

Describe the problem you'd like to have solved

In the latest version of the Auth0 libraries for Xamarin. While I'm trying to create an archive, when I set the linker to don't link, I am getting the exception message: Error processing method: 'System.Void Auth0.OidcClient.Auth0ClientBase/<RefreshTokenAsync>

Describe the ideal solution

You might be able to add this attribute to prevent this https://learn.microsoft.com/en-us/xamarin/android/deploy-test/linker#preserving-code I tried the other possible solutions mentioned in the link, but they didn't work

Alternatives and current work-arounds

Additional information - Stack Trace

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Legacy.targets(649,5): error XALNK7000: Mono.Linker.MarkException: 
Error processing method: 'System.Void Auth0.OidcClient.Auth0ClientBase/<RefreshTokenAsync>d__12::MoveNext()' in assembly: 'Auth0.OidcClient.Core.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Threading.Tasks.Task`1<IdentityModel.OidcClient.Results.RefreshTokenResult> IdentityModel.OidcClient.OidcClient::RefreshTokenAsync(System.String,IdentityModel.Client.Parameters,System.Threading.CancellationToken)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod (Mono.Cecil.MethodReference reference) [0x00013] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00049] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00040] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x000c2] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x001b1] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x0001b] in <68c6268fbc45467eab046a8db2d5d932>:0 
 --- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00047] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue () [0x0000a] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Steps.MarkStep.Process () [0x000f6] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x0000d] in <68c6268fbc45467eab046a8db2d5d932>:0 
at MonoDroid.Tuner.MonoDroidMarkStep.Process (Mono.Linker.LinkContext context) [0x0000b] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Pipeline.ProcessStep (Mono.Linker.LinkContext context, Mono.Linker.Steps.IStep step) [0x0000d] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x0000f] in <68c6268fbc45467eab046a8db2d5d932>:0 
at MonoDroid.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <68c6268fbc45467eab046a8db2d5d932>:0 
at MonoDroid.Tuner.Linker.Process (MonoDroid.Tuner.LinkerOptions options, Mono.Linker.ILogger logger, Mono.Linker.LinkContext& context) [0x00071] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Xamarin.Android.Tasks.LinkAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x0018f] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Xamarin.Android.Tasks.LinkAssemblies.RunTask () [0x0001b] in <68c6268fbc45467eab046a8db2d5d932>:0 
at Microsoft.Android.Build.Tasks.AndroidTask.Execute () [0x00000] in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:17 
frederikprijck commented 1 year ago

Thanks for creating an issue, can you please provide a reproduction using our sample application? https://github.com/auth0-samples/auth0-xamarin-oidc-samples

That makes it easier for us to try and help.

frederikprijck commented 1 year ago

Closing due to no activity.