whenever I run "ionic cordova run android" and deploy the apk in the real device, I got error message: Access to XMLHttpRequest at 'http://XXXX/mobile/data/1/XXXX' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
(this works in the ionic simulator by adding the proxy in config file, but not the real device).
Does anyone face this problem as well? here is my ionic info: ionic (Ionic CLI) : 4.2.1 (/usr/local/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.1.2 ([email protected]) Cordova Platforms : android 7.1.2 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.3, (and 8 other plugins)
System:
NodeJS : v8.12.0 (/usr/local/bin/node) npm : 6.4.1 OS : macOS High Sierra