How to fix the issue – Option 2

Starting with the latest version of Ti.Map, open the relevant folder (e.g. 2.0.5)

Open the manifest file using TextEdit

Check the mindsdk property. If it says 3.4.0, then it will only work for iOS 8 Builds

If you want to still develop for iOS7 and use Ti.Map globally for all your apps, then you will need to delete the version of Ti.Map relevant to the above-mentioned

In my case, I needed to delete the 2.0.4 and 2.0.5 folders. Now, my latest version of Ti.Map is 2.0.2

The error I was getting

I mentioned in a previous post of mine, that the reason I upgraded Titanium Studio to version 3.4.0, was because Xcode 6 silently installed itself on my machine. When I upgraded Titanium to 3.4.0, I got the following error message when trying to run a build for an iOS7 app that makes use of the Ti.MAP module:

My assumption of what happened

So, here’s a shot in the dark of what happened. When upgrading to Titanium Studio 3.4.0, Appcelerator saw that I had the Ti.Map module (which Appcelerator developed) and immediately downloaded the latest version (2.0.4 or 2.0.5), which I assume is required for iOS 8 development.

The truth is, I can’t remember what version of Ti.Map I installed last, but I do know that it was working. When I opened the modules folder on my Mac, the latest version was 2.0.4.

At this time I thought that maybe I downloaded 2.0.4 a while ago, and during the update of Titanium Studio this module was modified accidentally by the update.

My first attempt to fix the problem

First thing I did was check on Github what the latest version of Ti.Map was. I noticed 2.0.5 was released and downloaded that to my modules folder.

Sadly this did not fix the problem. I still received the same error as before.

My second attempt to fix the problem

I got a bit clever and opened the manifest file for version 2.0.5. I noticed that the minsdk parameter had a value of 3.4.0. I changed this to 3.2.3.

The good news is that my app was successfully running again. The bad news is that when launching any window that made use of the Ti.Map module I got the following error:

It was here that I finally made the assumption that Ti.Map 2.0.4 was automatically downloaded, as it contains code that only works in XCode 6.

My third attempt which finally fix the problem

What I did next was started from the latest version of Ti.Map, and checking backwards which version had a minsdk lower or equal to 3.2.3. In my case, it was version 2.0.2 of Ti.Map. So I deleted the 2.0.4 and 2.0.5 folders, reran my iOS7 build and Boom. Everything is working again.

I hope this helps everyone. I welcome any input that would assist in understanding what happened here.

As Boydlee points out, the better solution is to specify the version of the module you want to use in your tiapp.xml. By default, no version number is specified meaning the last-installed (latest) version will be used.

In Studio, open tiapp.xml. In the visual editor, double-click the module in the Modules list. Then, select the version you want to use from the drop-downs.

If manually editing the tiapp.xml, add the version attribute to the module tag: <module platform=”iphone” version=”2.0.2″>ti.map</module>

If you don’t specify the explicit version of the module to use, it will pick the “latest” module. When I coded up the Titanium module library, I forgot to check if the “latest” module was actually supported by the SDK being used to build the app.

Unfortunately, this only works now for 3.4.0.GA and newer. 3.3.0.GA and older will still pick the latest module instead of the latest valid module.

As far as how modules are installed, they are in the Titanium SDK distribution zip file and blindly unzipped into your ~/Library/Application Support/Titanium directory. The zip contains a “mobilesdk” folder and a “modules” folder. That means if you install a CI build, you could potentially get some “dev” version of a module that may get chosen as the “latest” module. Another reason explicitly selecting a module version is a good idea.