Hi everyone!
I am developing an application in angular ionic that connects to an api node made by me as well. But I’m having trouble connecting them using an android device through the native http plugin, when I try to execute a login (which works when I do a local test in the web browser) using console logs, it gives me the error:
[ng] [console.log]: {
[ng] "status": -1,
[ng] "error": "There was an error with the request: Failed to connect to /192.168.0.103:3000"
[ng] }
I have already tried the angular http plugin (@ angular / common / http) but it doesn’t work on the device either, it gives me the error:
[console.error]: "ERROR" {
[ng] "headers": {
[ng] "normalizedNames": {},
[ng] "lazyUpdate": null,
[ng] "headers": {}
[ng] },
[ng] "status": 0,
[ng] "statusText": "Unknown Error",
[ng] "url": "https://192.168.0.103:3000/users/login/",
[ng] "ok": false,
[ng] "name": "HttpErrorResponse",
[ng] "message": "Http failure response for https://192.168.0.103:3000/users/login/: 0 Unknown Error",
[ng] "error": {
[ng] "isTrusted": true
[ng] }
[ng] }
My info:
Ionic:
Ionic CLI : 6.13.1 (C:\Users\ezeba\AppData\Roaming\npm\node_modules\@ionic\cli)
Ionic Framework : @ionic/angular 5.6.5
@angular-devkit/build-angular : 0.1102.10
@angular-devkit/schematics : 11.2.10
@angular/cli : 11.2.10
@ionic/angular-toolkit : 3.1.1
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 9.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 8 other plugins)
Utility:
cordova-res : not installed
native-run : 1.3.1
System:
NodeJS : v15.14.0 (C:\Program Files\nodejs\node.exe)
npm : 7.7.6
OS : Windows 10
I tried all the supposed solutions that I found on the internet, but none worked for me, could someone give me a hand with this? I would thank you a lot!
Regards!
PD: Sorry for my bad english! I´m not the best in the language