Home > Uncategorized > Appcelerator Titanium.include Simulator Works, Device Fails

Appcelerator Titanium.include Simulator Works, Device Fails

I’ve been writing a lot of mobile apps for KeyLimeTie, which means I’ve been working with Appcelerator Titanium a lot. The basis of the platform is you write a bunch of javascript, using the “Titanium” namespaces to build up your native iOS and Android app. One particular feature is “Titanium.include(‘myfile.js’);”, which acts just like a PHP include(‘myfile.php’)–inlines whatever code is in the file and runs it.

Here’s where I hit some trouble, and wasted a couple of hours of my time. Everything was working in the iPhone simulator, but when I would deploy to my iPad for testing, the program would hang at the loading screen. Through liberal use of alert(“I made it this far!”), I was able to figure out that a function wasn’t getting included from one of my Titanium.include’d files. In fact, the file wasn’t getting included at all.

The solution? I had messed up the capitalization in my include statement. My file was named Foo.js, and I was trying to include foo.js. The simulator was smart enough to work this out, but the device failed to do so.

Moral of the story? Always check caps.

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.