Open Closed

HTTPS post Issue on Maui IOS #6367


User avatar
0
team.net created
  • ABP Framework version: v7.2.1
  • UI Type: MAUI
  • Database System:SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:

2023-12-18 19:09:59.846777+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem. 2023-12-18 19:09:59.847077+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable. 2023-12-18 19:09:59.847246+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem. 2023-12-18 19:09:59.847368+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable. 2023-12-18 19:09:59.847513+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem. 2023-12-18 19:09:59.847634+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable. 2023-12-18 19:09:59.847760+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem. 2023-12-18 19:09:59.847879+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable. 2023-12-18 19:09:59.848012+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem. 2023-12-18 19:09:59.848126+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable. 2023-12-18 19:09:59.848223+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem. 2023-12-18 19:09:59.848324+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable. 2023-12-18 19:10:01.635073+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] CGContextSetLineDash: invalid dash array: at least one element must be non-zero. System.Net.Http.HttpClient.Default.LogicalHandler: Information: Start processing HTTP request POST https://frps-web-app-api-dev.azurewebsites.net/api/app/contractors/submit-approval-for-current-user?api-version=1.0 System.Net.Http.HttpClient.Default.ClientHandler: Information: Sending HTTP request POST https://frps-web-app-api-dev.azurewebsites.net/api/app/contractors/submit-approval-for-current-user?api-version=1.0 2023-12-18 19:10:02.326116+0530 ETVSoftware.FirstResponders.WebApp.Maui[7959:311694] [Unknown process name] CGContextSetLineDash: invalid dash array: at least one element must be non-zero. System.Net.Http.HttpClient.Default.ClientHandler: Information: Received HTTP response headers after 2174.4406ms - 400 System.Net.Http.HttpClient.Default.LogicalHandler: Information: End processing HTTP request after 2177.2116ms - 400 Thread finished: <Thread Pool> #20

While making POST Request getting 400 on MAUI IOS but working fine on Android.

on my maui project inside CompleteRenewOfficerAgreementPageViewModel class this is how i inject the interface of my api public CompleteRenewOfficerAgreementPageViewModel(IContractorsAppService contractorsAppService)

** this is my view model inherited from** public class CompleteRenewOfficerAgreementPageViewModel : FirstRespondersViewModelBase, ITransientDependency

** this is the api calling line ** await _contractorsAppService.SubmitApprovalForCurrentUserAsync(postData);


23 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Could you share a simple test project? I will check it.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    My email is shiwei.liang@volosoft.com

  • User Avatar
    0
    team.net created

    is it okey if i share only the maui project? or do you need the api too?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Yes, please.

    You can create a new project to reproduce the problem.

  • User Avatar
    0
    team.net created

    alright

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    : )

  • User Avatar
    0
    team.net created

    Hi i have shared the project at your mail address. can you check? mine is ayan@sentientgeeks.com

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I have checked, but could not reproduce the problem,I guess this may have something to do with your development environment.

  • User Avatar
    0
    team.net created

    can you check that with a live server? we are using azure.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    we are using azure.

    What's the Live server URL

  • User Avatar
    0
    team.net created

    can you check the email again. I have shared a new project which clearly demonstrate the issue. just to be clear it is working fine in android but not in IOS.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Ok, but I didn't receive the email, could you send it again? thanks.

    just to be clear it is working fine in android but not in IOS.

    When I try locally, it works as expected. https://support.abp.io/QA/Questions/6367#answer-3a0fc09f-f2f6-10d1-4ebf-899c15166bc3

  • User Avatar
    0
    team.net created

    can you check your mail?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I got it and will check it. thanks.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Sorry, When I tried to download the project, I found that there was no download link.

  • User Avatar
    0
    team.net created

    Check this link ~~*************~~

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi, Sorry, but I still could not reproduce the problem. Maybe I missing something, could you share the full steps to reproduce? thanks.

  • User Avatar
    0
    team.net created

    HI the issue is still persistent at our end. https://sentientgeeks-my.sharepoint.com/:v:/p/ayan/EWYu3dPXDy9Is76BpzTiN9oBCqktp1Rx0YPR5UfBv131Cw?nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJPbmVEcml2ZUZvckJ1c2luZXNzIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXciLCJyZWZlcnJhbFZpZXciOiJNeUZpbGVzTGlua0NvcHkifX0&e=wBDHJ3

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I remember that this seems to be a cookie problem and we fixed this problem in the new version.

    You can try update the GetInsecureHandler method:

    //https://docs.microsoft.com/en-us/xamarin/cross-platform/deploy-test/connect-to-local-web-services#bypass-the-certificate-security-check
    private static HttpMessageHandler GetInsecureHandler()
    {
    #if ANDROID
        var handler = new HttpClientHandler()
        {
           UseCookies = false
        };
        handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
        {
            if (cert is { Issuer: "CN=localhost" })
            {
                return true;
            }
    
            return errors == System.Net.Security.SslPolicyErrors.None;
        };
        return handler;
    #elif IOS
        var handler = new NSUrlSessionHandler
        {
            UseCookies = false,
            TrustOverrideForUrl = (sender, url, trust) => url.StartsWith("https://localhost")
        };
        return handler;
    #elif WINDOWS || MACCATALYST
        return new HttpClientHandler()
        {
            UseCookies = false
        };
    #else
         throw new PlatformNotSupportedException("Only Android, iOS, MacCatalyst, and Windows supported.");
    #endif
    }
    
  • User Avatar
    0
    team.net created

    i m sharing the project again. can you confirm it just to be at a safe end ******

  • User Avatar
    0
    team.net created

    well i did, also update the uri with our azure uri but it throwing me the error

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can try those:

    • https://support.abp.io/QA/Questions/6367#answer-3a0feadc-dbe4-399c-59be-a15fbdfc4339
    • run abp clean command
    • run dotnet build command

    Here is the same problem: https://support.abp.io/QA/Questions/6271/Abp-v8-preview-rc2-upgrade-maui-antiforgery-token-problem

  • User Avatar
    0
    team.net created

    looks like just adding the UseCookies = false, was not enough, i had to remove the bin folder manually and then rerun the project fix the issue.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 18, 2025, 10:42