I am using ionic3 for my application development. I am getting below error for android application for the first time installation. Then after re launching the app is working correctly.
Access to XMLHttpRequest at ‘’ from origin ‘file://’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
3. checked for upgrading webview and whitelist plugin as well.
Nothing worked.
Please suggest for changes if needed. even in production build we have not done any change in Backend or frontend. But, it is happing on production old working application as well. Please help us to fix this.
Seeing a similar issue only on a new/fresh install of the app. Restarting the app resolves the issue which is strange.
I have a feeling it is to do with a new version of Android. (I’m on 9, 1 July 2019 security patch level, kernel version 4.4.153-perf+, Nokia 9) as old builds of the app have the same issue.
Access to XMLHttpRequest at ‘the url’ from origin ‘file://’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource’.
The “Origin: http://” header does not appear to be sending to the server.
the services are working which have Access-Control-Allow-Origin=* in the response header. this I understood till now. Please keep us posted. If any one is getting the solution.
Ionic app uses WebView because it’s a hybrid App. WebView is nothing but a Chrome browser without address bar on Android and Safari browser on iOS.
Recently Google has updated chrome to 76 version due to which WebView is not working first time. WebView needs to be restarted then only it will work that’s why it works on second launch after killing the app.
Below are the links which justifies this and Chrome 76 update has broken many things for Google themselves:
Access to XMLHttpRequest at ‘’ from origin ‘file://’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
WebView needs to be restarted then only it will work that’s why it works on second launch after killing the app.
This is happening in production apk build,
Please let us know any solution to come out of this issue .
I am also facing the same issue. i have updated the google chrome then it is working fine, But my application on Production they are more than 2k users, It will be difficult to ask all of them to upgrade the google chrome
is there any other way, we can do it on app itself. I am trying to upgrade the webview in application but nothing working. Please suggest something, Thanks in Advance
Actually we are using chrome as webview now.then it’s not possible. And this the 3rd party issue. We can’t do anything from our side. If you wanted to do dirty fix then you can forcefully close the app for the first time and then restart the app again. Then again you need to publish application.
@Maheshvy you can use armv-7 folder apk, Old cordova version used to create this apk,
If you are using this apk you don’t want to bother about google version, because it is creating own webview and not using google web view
But we have recently android version released like 32 bit and 64 bit android architecture version for SDK 28 , this will taken care by armv-7 folder apk ?