DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

PhoneGap Build issue

Raymond Camden user avatar by
Raymond Camden
·
Jul. 05, 12 · Interview
Like (0)
Save
Tweet
Share
3.73K Views

Join the DZone community and get the full member experience.

Join For Free

The more frustrated I get with Android and tooling on my machines the more I fall in love with PhoneGap Build. It is - without a doubt - the easiest way to pump out native installable apps for your mobile projects. I've been working on a simple app for a friend of mine and when I finally switched from Eclipse-based builds to the Build service it just made everything better. Even easier - he could get downloads from Build whenever he wanted and share it with others.

I did run into one issue though that I wanted to make people aware of. For my application, I'm using the upload as zip option. In order for the correct cordova.js file to be included in your binary installers, you need to use a script tag like so:

<script src="cordova.js"></script>

The Build process will take care of ensuring the right file is included with the bits. However, if you are testing your application on the desktop while you build the project, you will most likely have a copy of the JavaScript file in your folder. You can't test device-specific functionality, but I had a copy of the JavaScript file there just to prevent Chrome from complaining about it.

When I created a zip of my code and uploaded it to Build, the normal behavior of replacing the JS file was not done. I think Build probably made the right decision and said, "If you specifically included this file then you must know what you're doing."

As soon as I tested my code on a real device I got errors on startup.

For me - the solution was to skip creating a zip of the entire www folder. Instead, I went into the folder, did a quick select all, and deselected the cordova.js file.

Hopefully this will help others if they run into the same issue. For this project I'm not using a public SVN/Git repo so I'm not sure if it would be an issue there.

Build (game engine)

Published at DZone with permission of Raymond Camden, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • A Complete Guide to AngularJS Testing
  • How to Develop a Portrait Retouching Function
  • How To Use Terraform to Provision an AWS EC2 Instance
  • Why Every Fintech Company Needs DevOps

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: