Hi! This is my first post here. Please bear with me if unknowingly I don’t go by the rules. So I recently updated Ionic and Cordova to latest version on my project (that is Cordova CLI 5.1.1, Gulp 3.8.11, Ionic CLI 1.6.1, Ionic App Lib 0.3.3 and Node 0.10.36).
Ever since I did that I’m getting a lot of hangs and crashes in my app. I made some research and found out that I had to install the whitelist plugin. I did that. I added <access origin="*"/><allow-navigation href="*"/><allow-intent href="*"/> in my config.xml file. I also added <meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-eval' 'unsafe-inline'"> in my index.html file. But again, the app is freezing.
When debugging through Chrome, it shows that none of the external scripts that my app uses are being loaded. Error message examples: Failed to load resource http://maps.google.com/maps/api/js and Failed to load resource http://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,700,500italic,900,700italic,900italic
So clearly whitelist isn’t doing what it’s supposed to do. Unless you think it’s something else?
If I do that, then I get the following error message when debugging: Refused to load the script 'http://maps.google.com/maps/api/js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval'".
I was saying that it used to work before expressly so that I wouldn’t get questions like “are you connected to the internet?”.
I have both apk’s on my phone, i.e. the one compiled with older ionic/codova/ant and the one compiled with newest ionic/codova/gradle. If I install the older one, it works and can access remote resources. If I install the new one, I get these error messages.
Should I add any other directives/flags when building under new ionic/cordova? I currently use “ionic build android”. Is that correct? Because when I tried to force the new one to use ant to build like “ionic build android – --ant”, the app would simply crash on launch.
You always need to set these permissions (even when you’re on a native Android application), I wonder how your previous application worked without them.
I have the same 404 errors with the same setup. Permissions are in place on my AndroidManifest and I have all of the above from the meta tag and config.xml entries for the whitelist plugin.
Hi @Gajotres@akash21 , I have the similar issue. Works over http but fails over https. I am new these certificates and stuff. can you please tell me how to go forward and provide me steps to solve this issue…