Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9340] iOS: Titanium classes not found when compiling for device

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2012-06-07T17:51:07.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-12 Core
ComponentsTooling
Labelscore
ReporterPedro Enrique
AssigneeStephen Tramer
Created2012-06-01T13:01:57.000+0000
Updated2012-09-04T16:44:46.000+0000

Description

Problem

A Titnaium class, like Ti.UI.createWindow(), will not be included in the app if deployed to device and file in which it is declared is in the iphone folder.

To reporduce:

1. Create a new app 2. Place this is app.js
var W = {};
Ti.include('mainwindow.js');
W.MainWindow().open();
3. Create a new file and call it mainwindow.js 4. Place this file in the iphone folder (inside of the Resources) 5. Place this code in that file:
W.MainWindow = function(){
	var win = Ti.UI.createWindow({
		backgroundColor: '#ccc'
	});
	var map = Ti.Map.createView();
	win.add(map)
	return {
		open: function(args){
			args = args || {};
			win.open(args);
		}
	}
}
6. Run the app in the simulator 7. In the sim everything runs fine. 8. Run the app in the real device 9. red screen of death will pop up!

My guess of the source of the problem

- compiler.py - ignoreDirs = ['.git','.svn','_svn','CVS','android','iphone','mobileweb']; The code gets copied to the final built, but apparently the add_symbol() is never called in those files in the "iphone" dir inside the Resources dir.

Comments

  1. Shyam Bhadauria 2012-07-16

    Adding environment info - Tested with Titanium SDK: 2.1.1.v20120712160111 Tested with Titanium  Studio: 2.1.0.201206251749 Device - iPad 1 iOS 5.1, Simulator Machine OS - MAC 10.7.3

JSON Source