How do I fix PhoneGap build errors? - javascript

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

Related

Images or JS not showing on Magento 2 installation

I've just installed Magento 2 onto my production server under a
development. subdomain. The install appeared to have been successful
but I've noticed there are no images or working javascript in both the
frontend and the backend.
After inspecting the source code, I found that files being called in
such as
http://dev.website.com/pub/static/frontend/Magento/luma/en_GB/css/print.css
don't actually exist. Any thoughts? I tried solutions on several
stacks but haven't had any luck.
Try this Before that take Backup
Remove everything, except .htaccess file from pub/static folder
Open up app/etc/di.xml find the path “Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink” and replace to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
Note: Remove entire files and folder under pub/static except .htaccess file.
For More info ref this http://www.dckap.com/blog/magento-2-admin-links-not-working-in-windows/
Other Solution
You can run below command from Magento root folder.
php bin/magento setup:static-content:deploy
This will download the content perfectly in respective folders.

ngCordova Plugins - Issue getting cordova.js included properly

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>

Correct minified/uglified/revv-ed JS on Windows, but empty file on Linux?

I've been pulling my hair lately. I have a Yeoman generated JekyllRB grunt/bower setup. The build works correct on my Windows machine but not on an automated Linux build machine.
With correct, I mean that I get a minified/uglified/revv-ed version of JQuery in
dist/js/50b6.app.js
On the continuous integration build setup, which runs Linux, I get an empty js file:
dist/js/d41d.app.js
I updated Grunt and all plugins to the latest version, without success. Analyzed my full Gruntfile.js, verified the src and dest of all the plugins and all seems the same, taking into account the difference in platform specific path separators.
Here is the link to the sources of my Jekyll site: site-ringo
Eventually, I was able to resolve this myself. I hadn't updated my local Bower components for a while. On my build server, I ended up with another version of JQuery than on my local machine. The newer JQuery was packaged differently leading to the jquery.js file being in another location. As such, the concat+uglify+rev build chain didn't pick up the correct file leading to the output file being empty.

Phonegap Android HTML wont update

I am trying to upload some code html and javascript code into phonegap to develop this app however when I update the files the program still runs the old code as to what was in the html file before. I have even started a new project and it will not change the old index.html image even though the code behind it is different. I'm really confused as to why this is and I was wondering what I could do to solve this. I even searched through the workspace index.html file and it is the correct file that I want in there but upon running it i am given the same your device is ready hello world. I checked the location of the files and everything is correct. It is very confusing. I am using eclipse by the way not phonegap build if that helps.
you need to build your project again.
cordova build android
But make sure you edit your files in www folder in parent folder.
Make sure you are updating the WWW file in the root Phonegap folder. Then you can run the command:
$ cordova build
or
$ phonegap build

Eclipse building workspace hangs after importing existing maven project because of JavaScript validation

When running Eclipse Kepler and importing an existing Maven project, Eclipse hangs during "Building Workspace (XX%)". Switching to the Progress tab reveals a "Validating nnn"; it looks like it’s validating a directory containing JavaScript files.
Kill Eclipse process.
Go to project folder and edit .project file.
Remove the following lines (it will disable failing JavaScript validator):
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
Save file.
Re-open Eclipse.
I faced the same problem when I tried to install Angular.js with bower in my project. I seems bower has lots of javascript files it downloaded automatically which caused my IDE to stuck in validation process for a long time. So, I solved this problem this way,
I first installed tern.js 0.9.0.
Then I went to the project properties, selected tern script path
included only the path I needed for validation, My project's
javascript folder. I excluded other path like placeholders,
Angular.js files, Jquery files.
I selected the Javascript from the properties again and did the same
things in include path's source.
My IDE currently working without freezing. I took help from there. Tern
I guess it can be helpful, where any IDE stuck due to lots of Javascript file.

Categories

Resources