Tag – App

Blog

  • posted by mark
  • on Jan. 22, 2014
(If you're just looking for the problems and solutions, and not the rant, skip to the bottom) Yesterday was an absolute write off. It was a write off because of my old friend Titanium Appcelerator. Regular readers of this site will know that I have a bit of a love / hate relationship with this product. For the uninitiated, Titanium Appcelerator is a cross platform IDE and toolset that allows for the development of mobile applications using Javascript, and builds for Android, iOS, Blackberry, Tizen and more. It's like PhoneGap, but advertises itself as compiling and optimizing the code so it's much closer to native development when it comes to performance. It does show, in our experience, aside from an initial delay starting up, the Appcelerator apps run a lot faster than PhoneGap ones. It's why we adopted it as our development platform of choice for clients looking for cross platform mobile and tablet applications, where budget, time or support constraints might not allow for native development, or where the client is looking to only maintain and develop everything from a single source. But it's not without it's problems, which takes me back around nicely to my original point. In the middle of last year I switched my primary development environment to Windows 8 in an attempt to give the platform another chance, having previously conducted the bulk of my work under Ubuntu Linux. After a few months of constant problems and workarounds, I was forced to switch back, and in doing so needed to update my development environment with the latest bits and pieces --- which broke my installation of Titanium Appcelerator. Problem 1 - The required installation of Node.js This is one area where Windows surprisingly won. When prompted with the update box for version 3+ of Appcelerator, Node.js was installed at the same time. Not so on Linux. To be fair, the Appcelerator site says this, and offers a guide at http://docs.appcelerator.com/titanium/latest/#!/guide/Installing_Node. The problem is that I followed the advice on there to set npm to use my home directory (or rather a directory inside my home directory), updated my environment path accordingly, and installed npm and nodejs via apt-get. I then tried via the IDE, and it didn't detect Node.js, trying to install it again. I won't bore you with everything I tried (including going through the command line), but safe to say after a lot of googling the issue but not finding a solution, it was solved by uninstalling npm and nodejs completely, stripping npm of it's installed packages and forcing the npm directory back to /usr/local (I even had to override this with the .npmrc file in my home directory since it insisted on picking up my old prefix even when it was removed). So with my prefix set to /usr/local I did: sudo apt-get install npm nodejs nodejs-legacy sudo npm install -g titanium titanium login .. and entered my login details titanium sdk install titanium setup .. and then stepped through the quick setup. During the initial attempts at this I ran in to .. Problem 2 "/usr/bin/env: node: No such file or directory" and "[ERROR] "/usr/bin/titanium" is an unrecognized command" After some googling on this one, I discovered that the former appeared because of a naming convention issue on ubuntu between node / nodejs. The answer here is to install the nodejs-legacy package. The latter issue is caused by this bug http://developer.appcelerator.com/question/160741, and the solution I used to get around it was to use Julien Vanier's fork as suggested in his comment: sudo npm install -g git://github.com/monkbroc/titanium.git .. and I'll switch back when they've fixed it. Problem 3 Android SDKs not found This one literally had be clawing at the walls. I have the Android SDK installed to /opt/share/android-sdks. Loading up the previous version of Appcelerator, it was just a matter of pointing this to the right directory, it would tell me what wasn't installed and using the link on the Dashboard I could invoke the android package manager and install what was missing. Not so now. It appears they've replaced it with a wizard which attempts to install the correct packages for you. So I provided my directory and it presented me with a series of checkboxes for what versions to install, then went ahead and downloaded them over the ones that were already installed. At the end of it, it complained that Android Platform 5.0 was required. Again, lots of frustration on this one, but eventually I got it solved by: - Ensuring that my Android tools and platform tools were on the path. - Invoking the Android package manager on the command line (android) and installing API 19, 14, 11, 10, 8 and 5 (you have to make sure Obsolete is selected for this) - Running "titanium setup" on the command line, then using the android setup to point it at this directory. Finally running a check after and it showed up. Well that's the end of my rant, hopefully the above will help anyone else who runs into the same issues as I did. I haven't decided to drop Appcelerator just yet as despite the negative tone of this post, it really is a great system to develop on and a massive time saver -- when it's working.

Back