{ "id": "117539", "key": "TIMOB-14641", "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": [ { "id": "11258", "description": "Holding Pen for Triaged Issues", "name": "Backlog", "archived": false, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-03-25T18:06:40.000+0000", "created": "2013-07-24T16:17:12.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" } ], "issuelinks": [], "assignee": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T07:43:04.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": "10230", "name": "BlackBerry", "description": "BlackBerry Platform" } ], "description": "h2. problem\r\n\r\nExecuting a {{titanium build}} without the --target option throws an error that the 99% of developers will have no idea how to work with, seen here:\r\n\r\n{code}\r\n/usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:181\r\n throw e;\r\n ^\r\nTypeError: Cannot read property '0' of undefined\r\n at BlackberryNDK.self.build (/Users/tlukasavage/Library/Application Support/Titanium/mobilesdk/osx/3.1.1.GA/blackberry/cli/common/blackberryndk.js:233:62)\r\n at build. (/Users/tlukasavage/Library/Application Support/Titanium/mobilesdk/osx/3.1.1.GA/blackberry/cli/commands/_build.js:140:15)\r\n at /usr/local/lib/node_modules/titanium/lib/cli.js:116:18\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:190:13\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:116:25\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:187:17\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:491:34\r\n at /usr/local/lib/node_modules/titanium/lib/cli.js:112:8\r\n at ChildProcess. (/Users/tlukasavage/Development/alloy/test/projects/Harness/plugins/ti.alloy/hooks/alloy.js:149:6)\r\n---------------------------------------------\r\n at /Users/tlukasavage/Development/alloy/test/projects/Harness/plugins/ti.alloy/hooks/alloy.js:142:11\r\n at /usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/async.js:14:6\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:190:13\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:94:25\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:187:17\r\n at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:459:34\r\n at /Users/tlukasavage/Development/alloy/test/projects/Harness/plugins/ti.alloy/hooks/alloy.js:90:9\r\n at exithandler (child_process.js:635:7)\r\n{code}\r\n\r\nIt appears it happens because the --target option is not explicitly set.\r\n\r\nh2. test case\r\n\r\nIn any Titanium app, execute the following:\r\n\r\n{code:bash}\r\ntitanium build -p blackberry\r\n{code} \r\n\r\n\r\nand you will get the above error. Just as an additional note, you get the same error if you explicitly define the BB NDK path (-n) and the ip address of the simulator (-A), which should obviously indicate that the target would be \"simulator\".\r\n\r\nh2. expected\r\n\r\nThere's a few possible solutions, listed in my preferential order:\r\n\r\n# Make the default target \"simulator\" like with all other platforms\r\n# Do better bounds checking around the line mentioned in the exception. Specifically, the length of the {{builder.type2variantCpu\\[this.builder.target\\]}} array needs to be validated before attempting to access index zero. If the array is empty, an informative error should be thrown, not the current stack trace.\r\n\r\nh2. Workaround\r\n\r\nExplicitly specify the --target in your command:\r\n\r\n{code:bash}\r\ntitanium build -p blackberry -T simulator -A XXX.XXX.XXX.XXX\r\n{code}", "attachment": [], "flagged": false, "summary": "Blackberry: Not specifying a \"target\" throws unhelpful error in CLI", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.1.1\r\nTi CLI 3.1.1\r\nBB NDK 10.0.1.1020", "comment": { "comments": [ { "id": "265349", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_blackberry/pull/151", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-07T16:26:26.000+0000", "updated": "2013-08-07T16:26:26.000+0000" }, { "id": "272239", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR no longer valid", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-09-20T22:02:49.000+0000", "updated": "2013-09-20T22:02:49.000+0000" }, { "id": "294667", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/205", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-02-25T21:08:46.000+0000", "updated": "2014-02-25T21:08:46.000+0000" }, { "id": "410228", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T07:43:04.000+0000", "updated": "2017-03-09T07:43:04.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }