Slow and Steady Upgrades Win the Race

April 22nd, 2013

I’m getting ready to release Anthropomotron 1.5 so I’m taking care of the little details like making sure the internal software is up to date. I saw that since last time, Phonegap has jumped up a few version numbers so I made a goal of running my app with the latest version as of right now. Along the way, I learned a few things about the safest speed at which to apply updates.

The Phonegap developers have this document for doing upgrades version to version. It looks easy enough. Each update has the same general procedure of replacing certain files along with some one-time actions that have to be done.

I tried following them all (from the bottom up) from my current version of 2.2.0, but the result was a giant crashy mess. I decided to restore my files via Time Machine and start over. This time I went go version by version, making sure that each one works before upgrading it to the next step. I still ran into problems but now I could handle them one at a time! I think a lot of these occurred because I originally made Anthropomotron in an older version of Xcode and a 1.x version of Phonegap so there was a lot of legacy stuff that got in the way of the new code. Here is the step by step so the next unfortunate soul will have a slightly better time. I started writing this at version 2.4.0 so the earliest fixes are a bit hazy.

2.2.0 to 2.3.0
I followed the steps but ran into build errors until I followed the advice on this page. Also, following the guide to new Phonegap installs, I added these lines to my index.html after the line that loads the Cordova Javascript itself:

<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
</script>

2.3.0 to 2.4.0
Once again I followed the steps but ran into build errors when I was done. Finding a solution took a bit more time since apparently fewer developers had the same issue. I did track down the tip that fixed the update problems for me. Opening project.pbxproj and deleting the three instances of the red-highlighted two lines did the trick for that error. The same problem from 2.3.0 to 2.4.0 could occur since this update writes over the MainViewController.m file. Add the 2.2.0 to 2.3.0 fix for that file again if necessary.

2.4.0 to 2.5.0
The instructions on the Phonegap site say 2.4.0 to 2.6.0 but we know what it means. The good news is that no new errors popped up! Woohoo!

2.5.0 to 2.6.0
The instructions on the Phonegap site say 2.6.0 to 2.6.0 but we know what it means. Also note that step 10 has you move one of the lines in config.xml from where you placed it in step 9. Just roll with it. I also didn’t do anything for step 11 and my app worked anyway (it doesn’t use Location Services). After all of that, Anthropomotron runs in the simulator! Time to deploy to my actual devices and try to crash them.

My whole goal with Anthropomotron is that one person does a bunch of work so other people don’t have to do the same thing. That philosophy extends to my app developing time so I hope someone benefits from this post. This week’s goal is to get the Android version up to date. The Phonegap update instructions for Android look far simpler so here is to hoping that it is more painless.


Leave a Reply