Ionic app apk file could not connect to the asp.net core web api

I tried running my Ionic project in the browser to connect to my web API within my network, and the API works. However, when I convert the Ionic project to an APK file using Android Studio and run it on an Android device, it does not connect to my API.

can anyone suggest for imediate response thanks.

looks like a CORS issue, but it’s better if you debug your app and check the connection

I am getting this error when I run the app in Android Studio emulator

Error: ‘File: https://localhost/polyfills.a945b0249cb630b5.js - Line 1 - Msg: Mixed Content: The page at ‘https://localhost/home’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘http://192.168.2.26/api/LoadLanIds/GetData’. This request has been blocked; the content must be served over HTTPS.’

And my app is could not open in offline its get webpage not avalible ‘net::ERR_CLEARTEXT_NOT_PREMITTED’ error what i do wrong pls guid me

By default doing http requests is not allowed since Android 9, search how to allow “cleartext traffic” on Android apps.

Also doing requests to http from https is disabled by default. Check allowMixedContent configuration option to enable them.