{ "id": "149998", "key": "TIMOB-19285", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2015-07-31T16:23:22.000+0000", "created": "2015-07-29T23:05:03.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "qe-5.0.0", "regression" ], "versions": [ { "id": "16925", "description": "WatchKit Support--all going into 5.0 now", "name": "Release 5.0.0", "archived": true, "released": true, "releaseDate": "2015-09-16" } ], "issuelinks": [ { "id": "48551", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "inwardIssue": { "id": "150114", "key": "TIMOB-19309", "fields": { "summary": "Cannot install to iOS device with latest SDK", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "48841", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "150854", "key": "TIMOB-19447", "fields": { "summary": "Launching titanium app from latest fails on OS X", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2015-09-01T21:49:41.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" }, { "id": "10207", "name": "Tooling" } ], "description": "h5.Description\r\n\r\nWhen building to a device and including commonjs modules the app will crash with {{\\[ERROR] Script Error Couldn't find module: ti.cloud for architecture: arm64}}. Requiring modules such as ti.map work fine.\r\n\r\n*When building to simulator the app works fine*\r\n\r\nh5.Steps to reproduce\r\n\r\n1. Create a project using {{appc new}} and ensure services are enabled\r\n2.Build to device\r\n\r\nh5.Actual result\r\n\r\nThe app will crash with {{\\[ERROR] Script Error Couldn't find module: ti.cloud for architecture: arm64}}\r\n\r\nh5.Expected result\r\n\r\nThe app should not crash", "attachment": [ { "id": "56283", "filename": "commonjs.example.test1.zip", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-07-30T05:17:53.000+0000", "size": 1435, "mimeType": "application/zip" }, { "id": "56312", "filename": "Screen Shot 2015-07-31 at 9.45.01 AM.png", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-07-31T16:54:11.000+0000", "size": 30070, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: App throws error when building to device with commonjs modules", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "Appc CLI (Core): 4.2.0-1\r\nTi SDK: 4.2.0.v20150729134419\r\nXcode 6.4\r\niPhone 6 8.2", "closedSprints": [ { "id": 455, "state": "closed", "name": "2015 Sprint 15 Tooling", "startDate": "2015-07-20T16:26:19.926Z", "endDate": "2015-08-08T01:26:00.000Z", "completeDate": "2015-08-03T20:10:37.386Z", "originBoardId": 121 } ], "comment": { "comments": [ { "id": "358575", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Additional info: 4.1.0.GA works. Only 4.2.0 fails. Something related to handling commonjs modules or specifically ti.cloud module must have changed somewhere in titanium_mobile ", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-07-30T03:19:16.000+0000", "updated": "2015-07-30T03:19:16.000+0000" }, { "id": "358579", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~cng] I believe it is all commonjs modules, I made a basic module which I have attached and that also throws an error.\r\n\r\nAlso I believe that it is symlinking the commonjs file when it builds. If I open up the .app for the project I built then the commonjs file is shown as an alias which links to the file in my Titanium module location, which is probably the root cause of this ", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-07-30T05:14:36.000+0000", "updated": "2015-07-30T05:24:29.000+0000" }, { "id": "358580", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Thanks [~eharris], think I have pinpointed the problem. It's with the generated ApplicationMods.h. It used to contain all the definitions of modules, now 4.2.0 it's empty.\r\nAlso realized ApplicationDefaults.m is different in both versions as well.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-07-30T05:28:39.000+0000", "updated": "2015-07-30T05:34:44.000+0000" }, { "id": "358581", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Additional info: using ti create, ti build to device, it's ok. So most likely this is related to appc_cli too.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-07-30T07:19:49.000+0000", "updated": "2015-07-30T07:19:49.000+0000" }, { "id": "358587", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR here: https://github.com/appcelerator/titanium_mobile/pull/6997\r\nTested that appc run works for both simulator and device. And so far it looks like it hasn't changed any original ti build behavior.\r\nBasically i made sure that the ApplicationMods.m and ApplicationDefaults.m file contents are the same as what appc used to produce in 4.1.0.GA, and also added a rule not to symlink commonjs modules, and to only copy if file didn't exist.\r\n[~cbarber], please review to see if this is ok. Only thing I'm not sure how to tackle is, if the commonjs module is updated to a newer version in the installed SDK, how does builder.js register the change and copy the file accordingly.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-07-30T09:26:45.000+0000", "updated": "2015-07-30T09:26:45.000+0000" }, { "id": "358723", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "This works as expected. The example MUST go in a platform directory named \"commonjs\":\r\n\r\n{code}\r\nmkdir -p modules/commonjs\r\ncd modules/commonjs\r\nunzip commonjs.example.test1.zip\r\n{code}\r\n", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-07-31T16:23:22.000+0000", "updated": "2015-07-31T16:23:22.000+0000" }, { "id": "358725", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~cbarber] the modules are inside the modules/commonjs folder in the Titanium SDK, see attached screenshot, I can still reproduce this using the latest SDK(4.2.0.v20150730093157). Also below is the output showing that the ti.cloud.js inside my app is a symlink to the one inside my modules folder\r\n\r\n{code}\r\nEwans-MacBook-Pro:testApp1234 eharris$ ls -l /Users/eharris/Documents/Appcelerator_Studio_Workspace/testApp1234/build/iphone/build/Debug-iphoneos/testApp1234.app/\r\ntotal 38760\r\n-rw-r--r-- 1 eharris staff 635075 Jul 31 09:42 Default-568h@2x.png\r\n-rw-r--r-- 1 eharris staff 610220 Jul 31 09:42 Default-667h@2x.png\r\n-rw-r--r-- 1 eharris staff 2004257 Jul 31 09:42 Default-Landscape-736h@3x.png\r\n-rw-r--r-- 1 eharris staff 622531 Jul 31 09:42 Default-Landscape.png\r\n-rw-r--r-- 1 eharris staff 1784621 Jul 31 09:42 Default-Landscape@2x.png\r\n-rw-r--r-- 1 eharris staff 1240741 Jul 31 09:42 Default-Portrait-736h@3x.png\r\n-rw-r--r-- 1 eharris staff 669227 Jul 31 09:42 Default-Portrait.png\r\n-rw-r--r-- 1 eharris staff 1826311 Jul 31 09:42 Default-Portrait@2x.png\r\n-rw-r--r-- 1 eharris staff 127342 Jul 31 09:42 Default.png\r\n-rw-r--r-- 1 eharris staff 413614 Jul 31 09:42 Default@2x.png\r\ndrwxr-xr-x 2 eharris staff 68 Jul 31 09:43 Frameworks\r\n-rw-r--r-- 1 eharris staff 1829 Jul 31 09:42 Info.plist\r\n-rw-r--r-- 1 eharris staff 808 Jul 31 09:42 KS_nav_ui.png\r\n-rw-r--r-- 1 eharris staff 811 Jul 31 09:42 KS_nav_views.png\r\n-rw-r--r-- 1 eharris staff 8 Jul 31 09:42 PkgInfo\r\ndrwxr-xr-x 3 eharris staff 102 Jul 31 09:43 _CodeSignature\r\n-rw-r--r-- 1 eharris staff 6836 Jul 31 09:42 appicon.png\r\n-rw-r--r-- 1 eharris staff 12393 Jul 31 09:43 embedded.mobileprovision\r\ndrwxr-xr-x 3 eharris staff 102 Jul 31 09:42 modules\r\n-rwxr-xr-x 1 eharris staff 9848608 Jul 31 09:43 testApp1234\r\nlrwxr-xr-x 1 eharris staff 95 Jul 31 09:42 ti.cloud.js -> /Users/eharris/Library/Application Support/Titanium/modules/commonjs/ti.cloud/3.2.9/ti.cloud.js\r\n{code}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-07-31T16:53:03.000+0000", "updated": "2015-07-31T16:53:03.000+0000" }, { "id": "358817", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~cbarber], aside from using the example, if you use \r\n{code}appc run -p ios -T device{code}\r\non a brand new *appc* project, it will copy a commonjs module, specifically ti.cloud, by default. And this is causing the error.\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-08-03T02:23:37.000+0000", "updated": "2015-08-03T02:23:37.000+0000" }, { "id": "358884", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~cng] Merged a ton of fixes. Try again. :)", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-08-03T19:32:49.000+0000", "updated": "2015-08-03T19:32:49.000+0000" }, { "id": "361988", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. Verified that if build a mobile app and install to device with commonjs modules, then I do not get any runtime errors.\r\n\r\nTested on:\r\n\r\nAppc CLI NPM: 4.2.0-1\r\nAppc CLI Core: 5.0.0-33\r\nArrow: 1.2.52\r\nSDK: 5.0.0.v20150901105514\r\nNode: v0.10.38\r\nOS: Yosemite (10.10.5)\r\nXcode: 7 beta 6\r\nDevices: iphone 6 (8.4.1)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-01T21:49:36.000+0000", "updated": "2015-09-01T21:49:36.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }