I am using Cordova with a Browser build. Project consists of a html page plus many js files in a directory structure 3 levels deep. I get 404 error for all script tags referencing files in the third level. All other script tags work ok. The project works fine outside of Cordova. I have checked all similar Cordova 404 problems on StackOverflow. Most refer to whitelist which I have checked/changed/re-checked.
The problem was an unused level 3 Test directory I had in my source. When I ran: cordova run browser, it silently choked on this directory and then stopped copying any more directories.
I removed the Test directory and all worked fine.
Sure, I am an idiot for not noticing this to start with but since I wasted so much time on it I thought I would post this to help others.
Related
I've been trying everything for the past two days to solve this issue. I'm well and truly stumped. Perhaps someone with greater knowledge than I can shed some light on the issue:
Basically, I'm building an app in AngularJS with the purpose of building Android and iOS apps from it using Cordova. I should specify that I am using cordova-cli on Linux and ngCordova (wrapper around plugins). I am NOT using Ionic Framework.
My app works fine in Chrome. I followed the ngCordova installation guide perfectly: http://ngcordova.com/docs/install/
I used bower to install. Then included the following in the index.html of my Web App project (not the Cordova project):
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
It didn't work. I thought maybe it's because the ng-cordova.js went into my bower components directory. So I changed that script tag to:
bower_components/ngCordova/dist/ng-cordova.js
When I go to my cordova project directory and set up the platforms, plugins etc... and run:
cordova build android
followed by
cordova run android
The app runs on my device (Nexus 5). I use chrome://inspect to see what happens when I click the button which should be using the email composer plugin: I get a cordova not defined error.
I went into the controller and put this in
console.log($cordovaEmailComposer);
I can examine this in chrome://insepct and it has all the correct functions etc.. so ng-cordova.js is running fine (thats where the factory for the plugin is).
I'm 99% sure the issue is that somewhere along the line cordova.js is being lost. When I go into the cordova project in the ProjectName/www/index.html the tag for cordova.js is commented out.
Same in the platforms/android/assets/www/index.html file.
I traced it back and the same is true in WebAppProject/dist/index.html file. It's commented out. So it seems that when I run grunt build cordova.js is being removed. I thought maybe it's because cordova.js wasn't in the WebAppProject so I brought it into the root directory (same locations as index.html) and it still happened.
Can anyone explain how to properly get this working? I'm totally at a loss. I've tried a million different ways of including cordova.js. I even manually uncommented it out in the cordovaproject/www/index.html. The app builds but crashs upon opening (white screen then dies) suggesting a missing script (despite cordova.js being n that directory too...).
Is this the grunt build process? Or am I totally setting up an ngCordova project incorrectly without realising... I would post some code but I'm 99% sure the issue is with cordova.js or the way the project is building upon either grunt build or cordova build.
Any help would be much appreciated. :)
Cheers,
D
Make sure to include ngCordova before cordova.js and after angular.js.
<script src="/path/to/angular.js"></script>
<script src="/path/to/ng-cordova.js"></script>
<script src="/path/to/cordova.js"></script>
I have this app that seems to run normally on localhost but when I deployed it to meteor or digital ocean, then from sudden reason, no functionalities work...
Here is the screencast localy: http://screencast.com/t/tyD995EyM
Here is the current hosted version on meteor: cryptonic.meteor.com
And digital ocean: 104.236.90.81
Code repo on git if it helps... https://github.com/lklancir/cryptonic
Could anyone at least help me locate the problem or point in direction, no major console log errors...
I might be guessing that maybe some JS files are killing each other when composed in one single .js file on upload, but why does it work locally is the thing that bothers me
I do see this error in the console on the meteor.com site...
Uncaught ReferenceError: gnMenu is not defined
I'm not completely sure, but I think it might be a file loading order. You have client/lib/custom.js which uses gnMenu from client/lib/gnmenu.js
Since all files in lib are loaded first, there might be a load order issue. Per the http://docs.meteor.com/#/full/structuringyourapp page, the files should be loaded from lib in alphabetical order so this would be an issue as custom.js would be loaded first, but I do not know why it would work on local...
HTML template files are always loaded before everything else
Files beginning with main. are loaded last
Files inside any lib/ directory are loaded next
Files with deeper paths are loaded next
Files are then loaded in alphabetical order of the entire path
In short:
How can I build and deploy using TeamCity multiple versions of jQuery?
Long way:
existing info:
Two files from jQuery (jquery-2.1.1.js and jquery-2.1.3.js) are checked into the source control (TFS) in absolutely same 100% way (Build Action -> "Context"). In parallel, in the same directory, all identical.
Local Build and deploy using MSStudio 12 works without any issues copying at the end of the build both files into Scripts directory
when it runs from TeamCity, it fails to find the relevant "meant to be copied" files and comes back with the following error:
"C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(608,
5): Copying file Scripts\jquery-2.1.3.js to
obj\Debug\AspnetCompileMerge\Source\Scripts\jquery-2.1.3.js failed.
Could not find file 'Scripts\jquery-2.1.3.js'"
Would someone help me to understand what is going on?
I love CodeKit, but for some reason, it stopped "watching" for changes to the files in the folder I placed in there. I double checked the project configuration to make sure the output paths are correct, but when I make a change to any of the files being watched, CodeKit does nothing -- no minifying, syntax checking, compiling down .scss files to .css.
As the developer suggested to "refresh" CodeKit, I launched the app while holding down shift and sure enough CodeKit opened with no projects. So I re-added the project, and still, it is not watching the files. Has anybody ever encountered this with CodeKit?
I have experienced a similar issue before and it was because in the codekit project I had included the images folder and I generated a huge amount of .png images. Every time codekit ran it got hung up processing the pngs trying to compress them.
Try putting your images folder outside of your codekit project directory and see if that helps.
I've been having the same problem lately (Version 2.1.9). I haven't managed to figure out the root cause as yet, but I have figured out a way to solve this issue every time it occurs.
Rename your parent folder that contains all of your CodeKit projects. E.g. my HTDocs equivalent folder is called "Sites". In Terminal do this:
mv sites sites_temp
mv sites_temp sites
The first line will rename your sites folder to sites_temp, and then the second line will do the opposite.
For some reason this works every time for me.
I've written a short blog post on this matter here, but to be honest the above is my go-to solution whenever this problem occurs: http://www.joetannorella.com/codekit-mac-auto-compiling-compass-upon-file-change/
I am trying to build a PhoneGap-based iPhone application, but I keep getting the following two errors:
./build-phonegap.sh: line 6: ./configure: No such file or directory
cp: lib/iphone/phonegap-min.js: No such file or directory
I built and installed the latest version of PhoneGap from the source on GitHub. I have checked to make sure that the PHONEGAPLIB variable is indeed set in XCode.
Where do I get the files listed? Where do I put them (to what are those paths relative)? And why aren't they already there?
Later
It seems the problem was that the project had been created with one version of PhoneGap (one that doesn't reference an external lib directory), but I was trying to run it with a newer one. Recreating the project with my latest version and copying over the www directory fixed the problem.
I am confused. What steps do I take? I just downloaded phonegap. I don't know how to "install" it. Do I have to run some git command or some build command before I can open it in xcode?
UPDATE:
Figured it out. I downloaded it. Unzipped it. Went into the phonegap folder. Duplicated the iphone folder. Opened xcode and hit build and go. It worked.
Apparently your iphone gap projects need to be a subfolder of the phonegap folder. That can probably be fixed/changed if you know what you're doing.
This video here helped me verify that all you need to do is download, unzip and open. The files inside your www do work by default.
http://www.youtube.com/watch?v=LcES5nIbMkk