Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19447] Launching titanium app from latest fails on OS X

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-09-01T17:52:46.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.0.0
ComponentsTooling
Labelsqe-5.0.0
ReporterJeff Haynie
AssigneeFeon Sua Xin Miao
Created2015-08-31T14:35:34.000+0000
Updated2015-09-01T21:25:38.000+0000

Description

Description:

Script Error Couldn't find module: ti.cloud for architecture: x86_64 When creating a project from the Appcelerator CLI and building to simulator, the app throws a runtime error as shown. NOTE: This only occurs when creating a project from the Appc CLI. Creating a project using Studio with or without services runs as expected.

Steps to reproduce:

1) Using Appc CLI, create a new Titanium project 2) Use "appc run" command to launch, choose iOS simulator

Result:

Runtime error on device

Expected Result:

Application runs as expected

Note:

A diff on the projects prior to run (created in studio versus appc CLI) shows only the following additional lines included in the alloy.js in the project created by Appc CLI:
// added during app creation. this will automatically login to
// ACS for your application and then fire an event (see below)
// when connected or errored. if you do not use ACS in your
// application as a client, you should remove this block
(function(){
var ACS = require('ti.cloud'),
    env = Ti.App.deployType.toLowerCase() === 'production' ? 'production' : 'development',
    username = Ti.App.Properties.getString('acs-username-'+env),
    password = Ti.App.Properties.getString('acs-password-'+env);

// if not configured, just return
if (!env || !username || !password) { return; }
/**
 * Appcelerator Cloud (ACS) Admin User Login Logic
 *
 * fires login.success with the user as argument on success
 * fires login.failed with the result as argument on error
 */
ACS.Users.login({
	login:username,
	password:password,
}, function(result){
	if (env==='development') {
		Ti.API.info('ACS Login Results for environment '+env+':');
		Ti.API.info(result);
	}
	if (result && result.success && result.users && result.users.length){
		Ti.App.fireEvent('login.success',result.users[0],env);
	} else {
		Ti.App.fireEvent('login.failed',result,env);
	}
});

})();

Attachments

FileDateSize
Screen Shot 2015-08-31 at 7.31.51 AM.png2015-08-31T14:35:32.000+0000619355

Comments

  1. Jeff Haynie 2015-08-31

    on a subsequent launch, it worked. seems to be related to a new project.
  2. Jeff Haynie 2015-09-01

    should this be moved into TIMOB? seems like a blocker for the release to me.
  3. Chris Barber 2015-09-01

    This issue is reproducible by building an iOS app using any globally installed CommonJS module and doing a device or dist build: ti build -p ios -T device --build-only
       [INFO]  Processing JavaScript files
       [DEBUG] Copying and minifying /Users/chris/appc/workspace/testapp5/Resources/app.js => /Users/chris/appc/workspace/testapp5/build/iphone/assets/app_js
       [DEBUG] Copying and minifying /Users/chris/Library/Application Support/Titanium/modules/commonjs/ti.cloud/3.2.9/ti.cloud.js =>
           /Users/chris/appc/workspace/testapp5/build/iphone/assets/Users/chris/Library/Application Support/Titanium/modules/commonjs/ti_cloud/3_2_9/ti_cloud_js
                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       
    The map of JS files uses relative paths for the key. The only time the key is absolute is when you are using a global CommonJS module. The fix is pretty simple. If it's an absolute path, just do a path.basename() on the original file path. Note: This is not an Appc CLI specific issue. This is not an Alloy issue.
  4. Feon Sua Xin Miao 2015-09-01

    master: https://github.com/appcelerator/titanium_mobile/pull/7108 5_0_X: https://github.com/appcelerator/titanium_mobile/pull/7109
  5. Wilson Luu 2015-09-01

    Closing ticket as fixed. Verified that after I create a mobile project and launch te mobile app with latest mobile SDK, then I do not get the Couldn't find module error. Tested on: Appc CLI NPM: 4.2.0-1 Appc CLI Core: 5.0.0-33 Arrow: 1.2.52 SDK: 5.0.0.v20150901105514 Node: v0.10.38 OS: Yosemite (10.10.5) Xcode: 7 beta 6 Devices: iphone 6 simulator (9.0)

JSON Source