- 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)
-
0
Hi,
Could you share a simple test project? I will check it.
-
0
My email is shiwei.liang@volosoft.com
-
0
is it okey if i share only the maui project? or do you need the api too?
-
0
Yes, please.
You can create a new project to reproduce the problem.
-
0
alright
-
0
: )
-
0
Hi i have shared the project at your mail address. can you check? mine is ayan@sentientgeeks.com
-
0
-
0
can you check that with a live server? we are using azure.
-
0
Hi,
we are using azure.
What's the Live server URL
-
0
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.
-
0
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
-
0
can you check your mail?
-
0
Hi,
I got it and will check it. thanks.
-
0
-
0
Check this link ~~*************~~
-
0
-
0
HI the issue is still persistent at our end. https://sentientgeeks-my.sharepoint.com/:v:/p/ayan/EWYu3dPXDy9Is76BpzTiN9oBCqktp1Rx0YPR5UfBv131Cw?nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJPbmVEcml2ZUZvckJ1c2luZXNzIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXciLCJyZWZlcnJhbFZpZXciOiJNeUZpbGVzTGlua0NvcHkifX0&e=wBDHJ3
-
0
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 }
-
0
i m sharing the project again. can you confirm it just to be at a safe end ******
-
0
well i did, also update the uri with our azure uri but it throwing me the error
-
0
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
-
0
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.