title: PhoneGap "Failed to load resource: the server responded with a status of 404 (Not Found)"
body: <p>I have a web application that I recently tried converting into PhoneGap, but for some reason, when running it on my android, it doesn't have access to the internet. When debugging with chrome via usb, I see the error "Failed to load resource: the server responded with a status of 404 (Not Found)" for all external requests (e.g. loading google fonts as stylesheets from <code>fonts.googleapis.com</code> in my html, and calling firebase from my js).</p>
  
  <p>I'm using the default <code>&lt;access origin="*"/&gt;</code> directive, which, to my understanding, should allow full access.</p>
  
  <p>My complete <code>config.xml</code> is bellow:</p>
  
  <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.phonegap.helloworld" version="1.0.0"&gt;
    &lt;name&gt;MyApp&lt;/name&gt;
    &lt;description&gt;MyDescription&lt;/description&gt;
    &lt;author href="http://phonegap.com" email="support@phonegap.com"&gt;PhoneGap Team&lt;/author&gt;
    &lt;content src="index.html"/&gt;
    &lt;preference name="permissions" value="none"/&gt;
    &lt;preference name="orientation" value="default"/&gt;
    &lt;preference name="target-device" value="universal"/&gt;
    &lt;preference name="fullscreen" value="true"/&gt;
    &lt;preference name="webviewbounce" value="true"/&gt;
    &lt;preference name="prerendered-icon" value="true"/&gt;
    &lt;preference name="stay-in-webview" value="false"/&gt;
    &lt;preference name="ios-statusbarstyle" value="black-opaque"/&gt;
    &lt;preference name="detect-data-types" value="true"/&gt;
    &lt;preference name="exit-on-suspend" value="false"/&gt;
    &lt;preference name="show-splash-screen-spinner" value="true"/&gt;
    &lt;preference name="auto-hide-splash-screen" value="true"/&gt;
    &lt;preference name="disable-cursor" value="false"/&gt;
    &lt;preference name="android-minSdkVersion" value="14"/&gt;
    &lt;preference name="android-installLocation" value="auto"/&gt;
    &lt;gap:plugin name="org.apache.cordova.battery-status" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.camera" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.console" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.contacts" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.device" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.device-motion" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.device-orientation" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.dialogs" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.file" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.file-transfer" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.geolocation" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.globalization" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.inappbrowser" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.media" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.media-capture" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.network-information" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.splashscreen" source="npm"/&gt;
    &lt;gap:plugin name="org.apache.cordova.vibration" source="npm"/&gt;
    &lt;icon src="icon.png"/&gt;
    &lt;icon src="www/res/icon/android/icon-36-ldpi.png" gap:platform="android" gap:qualifier="ldpi"/&gt;
    &lt;icon src="www/res/icon/android/icon-48-mdpi.png" gap:platform="android" gap:qualifier="mdpi"/&gt;
    &lt;icon src="www/res/icon/android/icon-72-hdpi.png" gap:platform="android" gap:qualifier="hdpi"/&gt;
    &lt;icon src="www/res/icon/android/icon-96-xhdpi.png" gap:platform="android" gap:qualifier="xhdpi"/&gt;
    &lt;icon src="www/res/icon/blackberry/icon-80.png" gap:platform="blackberry"/&gt;
    &lt;icon src="www/res/icon/blackberry/icon-80.png" gap:platform="blackberry" gap:state="hover"/&gt;
    &lt;icon src="www/res/icon/ios/icon-57.png" gap:platform="ios" width="57" height="57"/&gt;
    &lt;icon src="www/res/icon/ios/icon-72.png" gap:platform="ios" width="72" height="72"/&gt;
    &lt;icon src="www/res/icon/ios/icon-57-2x.png" gap:platform="ios" width="114" height="114"/&gt;
    &lt;icon src="www/res/icon/ios/icon-72-2x.png" gap:platform="ios" width="144" height="144"/&gt;
    &lt;icon src="www/res/icon/webos/icon-64.png" gap:platform="webos"/&gt;
    &lt;icon src="www/res/icon/windows-phone/icon-48.png" gap:platform="winphone"/&gt;
    &lt;icon src="www/res/icon/windows-phone/icon-173-tile.png" gap:platform="winphone" gap:role="background"/&gt;
    &lt;gap:splash src="www/res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:qualifier="port-ldpi"/&gt;
    &lt;gap:splash src="www/res/screen/android/screen-mdpi-portrait.png" gap:platform="android" gap:qualifier="port-mdpi"/&gt;
    &lt;gap:splash src="www/res/screen/android/screen-hdpi-portrait.png" gap:platform="android" gap:qualifier="port-hdpi"/&gt;
    &lt;gap:splash src="www/res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:qualifier="port-xhdpi"/&gt;
    &lt;gap:splash src="www/res/screen/blackberry/screen-225.png" gap:platform="blackberry"/&gt;
    &lt;gap:splash src="www/res/screen/ios/screen-iphone-portrait.png" gap:platform="ios" width="320" height="480"/&gt;
    &lt;gap:splash src="www/res/screen/ios/screen-iphone-portrait-2x.png" gap:platform="ios" width="640" height="960"/&gt;
    &lt;gap:splash src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios" width="640" height="1136"/&gt;
    &lt;gap:splash src="www/res/screen/ios/screen-ipad-portrait.png" gap:platform="ios" width="768" height="1024"/&gt;
    &lt;gap:splash src="www/res/screen/ios/screen-ipad-landscape.png" gap:platform="ios" width="1024" height="768"/&gt;
    &lt;gap:splash src="www/res/screen/windows-phone/screen-portrait.jpg" gap:platform="winphone"/&gt;
    &lt;access origin="*"/&gt;
    &lt;access uri="https://*.firebaseio.com" subdomains="true"/&gt;
    &lt;plugin name="cordova-plugin-whitelist" version="1"/&gt;
    &lt;allow-intent href="http://*/*"/&gt;
    &lt;allow-intent href="https://*/*"/&gt;
    &lt;allow-intent href="tel:*"/&gt;
    &lt;allow-intent href="sms:*"/&gt;
    &lt;allow-intent href="mailto:*"/&gt;
    &lt;allow-intent href="geo:*"/&gt;
    &lt;platform name="android"&gt;
      &lt;allow-intent href="market:*"/&gt;
    &lt;/platform&gt;
    &lt;platform name="ios"&gt;
      &lt;allow-intent href="itms:*"/&gt;
      &lt;allow-intent href="itms-apps:*"/&gt;
    &lt;/platform&gt;
  &lt;/widget&gt;
  </code></pre>
  
  <p>I was looking at questions here which appear to be related, and they mentioned that the problem might have to do with the <code>cordova-whitelist-plugin</code> and that adding a <code>Content-Security-Policy</code> meta directive in my html could help, but I couldn't figure out how to do that.</p>
  
  <p>EDIT:
  Here are some of the 404s I'm getting. The URLs work well from web version.</p>
  
  <pre><code>http://fonts.googleapis.com/css?family=RobotoDraft:regular,bold,italic,thin,light,bolditalic,black,medium Failed to load resource: the server responded with a status of 404 (Not Found)
  https://fonts.googleapis.com/css?family=Quicksand:300,400,700 Failed to load resource: the server responded with a status of 404 (Not Found)
  http://fonts.googleapis.com/css?family=RobotoDraft:regular,bold,italic,thin,light,bolditalic,black,medium Failed to load resource: the server responded with a status of 404 (Not Found)
  http://debug1.build.phonegap.com/target/target-script-min.js#15bded38-647a-11e5-95fa-22000b96d1a7 Failed to load resource: the server responded with a status of 404 (Not Found)
  </code></pre>