Reputation: 6121
I have an Ionic/Cordova app, running Ionic 1.7.14. Using ionic serve everything works perfectly. It builds error free, and when doing ionic run ios it successfully deploys to my device; however...
During run it finds the device and runs a bunch of copy commands, one thing that may be related is it counts up the percentage complete but only reaches 24%
On run I get a blank white screen. When I open safari dev tools to debug console reports "Failed to load resource:" for a everything except index.html (which loads up fine for whatever reason). To make things stranger, ionic cli reports copying some of the same files that are apparently unavailable to the app once deployed. eg:
from ionic cli
[ 8%] Copying /Users/joshua/source/prisontracker.app/platforms/ios/build/device/reportdevicesdemo.app/www/app/shared/azHelper.js to device
then from console of safari dev tools attached to live device
[Error] Failed to load resource: The requested URL was not found on this server. (azHelper.js, line 0)
When I look at the resources tab indeed it shows that all my js and a slew of other files were not copied over
-- How can I ensure ionic is copying all of my files from www during deploy?
Update I have ensured I have proper rwx permissions on the entire folder. I have also tore down and rebuilt platform ios. Lastly I tried to just open the generated project up in xcode to deploy from there. Identical behavior no matter what I try.
Again to note, everything works perfectly when I do ionic serve instead of trying to run on a device; it's simply that cordova isn't copying all of my files over properly.
Update2 Same exact result and behavior when deploying to Android device...
Upvotes: 1
Views: 1344
Reputation: 3205
This can happen if you have
$locationProvider.html5Mode(true);
and you have a base href like
<base href="/">
The solution is to remove from your index.html and set .html5mode to false
$locationProvider.html5Mode(false);
Upvotes: 1
Reputation: 6121
Huzzah! Turns out it was an errant <base href="/">
in my index causing Cordova to explode. Works as per normal without it
Upvotes: 1