I am using ionic native to build my application on android.
Sometimes when I run “ionic cordova run android --livereload” urls don’t work
and I am getting an error from the provider
{“headers”:{“normalizedNames”:{},“lazyUpdate”:null,“headers”:{}},“status”:0,“statusText”:“Unknown
Error”,“url”:null,“ok”:false,“name”:“HttpErrorResponse”,“message”:“Http failure response for (unknown url):
0 Unknown Error”,“error”:{“isTrusted”:true}}
Also a strange fact is that get always works. when I use post, or put I have the issue.
I am breaking my head to see whats wrong with it… urls seem ok no CORS issues since I am on my localhost and its the same ip. I am using config.ts to put the urls in there… Please can you tell me what I am doing wrong? I am very new to ionic.
This is my ionic info result
{ionic info
Ionic:
ionic (Ionic CLI) : 4.12.0 (C:\Users\themhz\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.8
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0
Cordova Plugins : not available
System:
Android SDK Tools : 26.1.1 (C:\Users\themhz\AppData\Local\Android\Sdk)
NodeJS : v8.11.1 (C:\Program Files\nodejs\node.exe)
npm : 6.0.0
OS : Windows 10
PS C:\xampp\htdocs\fcmsoft_m>
}
Please help for ionic app not run on device…
.
Using apk: C:\ionic\testdemo\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Package name: io.ionic.starter
Failed to install apk to device: [ 1%] /data/local/tmp/app-debug.apk
…
.
.
C:\ionic\testdemo\platforms\android\app\build\outputs\apk\debug\app-debug.apk: 1 file pushed. 3.6 MB/s (5593325 bytes in 1.488s)
Failure [INSTALL_FAILED_CONTAINER_ERROR]pk
[ERROR] An error occurred while running subprocess cordova.
cordova run android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
I don’t know what happen but I run ionic serve and everything works. I run ionic info and I get
Ionic:
ionic (Ionic CLI) : 4.12.0 (C:\Users\themhz\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.8
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.2.1, (and 12 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\themhz\AppData\Local\Android\Sdk)
NodeJS : v8.11.1 (C:\Program Files\nodejs\node.exe)
npm : 6.0.0
OS : Windows 10
It seems that Cordova plugins have been updated somehow. Now i run (ionic cordova run android --livereload) and all urls seem to work properly. I don’t know how Cordova pugins were updated
what does "ionic info " show?