Just trying to integrate Auth0 authentication into also my first Zamarin.Forms mobile app. THe exception is thrown at this line
var auth0LoginResult = await _auth0Client.LoginAsync(new { audience = AuthenticationConfig.Audience });
The new auht0 client instance is created in the as below constructor
private Auth0Client _auth0Client;
public AuthenticationService()
{
_auth0Client = new Auth0Client(new Auth0ClientOptions
{
Domain = AuthenticationConfig.Domain,
ClientId = AuthenticationConfig.ClientId
});
}
and the auth0client options are;
public static class AuthenticationConfig
{
public const string Domain = “”; // Domain from Auth0 portal
public const string ClientId = “”; // ClientId from Auth0 portal
public const string Audience = “”; // Audience from Auth0 portal
}
Method not found: int System.Text.Encodings.Web.TextEncoder.FindFirstCharacterToEncodeUtf8(System.ReadOnlySpan`1)
I have tried installing all the system.text nuget packages including System.Text.Encodings.Web, system.Memory, System.Text.Encodings.Extensions, System.Text.Encoding
Would appreciate if anyone could give me some tips on what to do or look for to debug
I am running into this problem now. It seems to sometimes work and most of the time not with iOS devices. Once it deploys to the device and works it will continue to work until I deploy again. I’ve tried updating all the packages above System.Text.Encodings.Web to 6.0, all previous versions as well, I’m tried System.Buffer and System.Memory, and even tried newtonsoft.json. I can’t figure out what allows it to work and what doesn’t, but it seems iOS has issues with System.Text.Json and it can’t always find the method required, but for some reason sometimes it does. I’m using VS 2022 V17.01 with a Xamarin Forms app and I can’t seem to find anything to make this consistent. Very disappointing, but the android works just fine.