CORS not working in apk but works in ionic serve( browser)

#1

in ionic serve cors is working in browser but not working apk

. In the browser (using ionic serve) it was working properly , but in apk (using ionic build android ) it was not working…

cordova plugin add cordova-plugin-whitelist (I have added this puigin using CLI)

I have used these things in config.xml


ionic.project
{
“name”: “sampleApp”,
“app_id”: “a2fbab8f”,
“proxies”: [
{
“path”: “/api”,
“proxyUrl”: “http://myserver/api
}
]
}

#2

Have you added whitelist plugins

#3

yes did rhat. (cordova plugin add cordova-plugin-whitelist)

I already mentioned above ,it is working browser …

#4

You need to debug you application into emulator, see http://gonehybrid.com/how-to-debug-the-white-screen-of-death-in-your-ionic-app/

#5

Thank you virender (that was very nice article ) it was help full to me.

I have added these to config.xml
access origin="
allow-intent href=”

allow-navigation href=”*"

in AndroidManifest.xml
uses-permission android:name=“android.permission.INTERNET” /
uses-permission android:name=“android.permission.ACCESS_NETWORK_STATE” /

but still problem not yet solved

#6

@iiitmahesh so let’s try to see if we can recreate this with a blank app first and figure out where the issue is. What steps would I need to take to recreate this issue?