{ "id": "80600", "key": "TIMOB-5358", "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": "12080", "description": "", "name": "Sprint 2011-40", "archived": true, "released": true, "releaseDate": "2011-10-10" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-10-05T10:20:40.000+0000", "created": "2011-09-26T08:28:47.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module", "module.py", "modules" ], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [ { "id": "12819", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "79048", "key": "TISTUD-572", "fields": { "summary": "Enable creation of module projects", "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": "Medium", "id": "3" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-12-21T15:28:35.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": "10207", "name": "Tooling" } ], "description": "I'm trying to work on module tooling in Titanium Studio and while testing generation of an Android mobile module project I ended up with an empty directory. After debugging, I see that the underlying process is returning a 0 exit code, but is actually failing. We typically use the exit code as an indicator of success or failure for native processes, and bubble up the failure based on that. In this case we got a 0 so we assumed success and never notified the user of the root cause.\r\n\r\nHere's what I saw as the output of the process in the debugger:\r\n{code}\r\nTraceback (most recent call last):\r\nFile \"/Library/Application Support/Titanium/mobilesdk/osx/1.7.2/module/module.py\", line 319, in \r\nmain(sys.argv)\r\nFile \"/Library/Application Support/Titanium/mobilesdk/osx/1.7.2/module/module.py\", line 316, in main\r\nmodule = ModuleProject(config['platform'],project_dir,config)\r\nFile \"/Library/Application Support/Titanium/mobilesdk/osx/1.7.2/module/module.py\", line 63, in __init__\r\nself.platform_delegate = ModulePlatform.create_platform(platform, project_dir, config, self)\r\nFile \"/Library/Application Support/Titanium/mobilesdk/osx/1.7.2/module/module.py\", line 34, in create_platform\r\nreturn platform_module_class(project_dir, config, module)\r\nFile \"/Library/Application Support/Titanium/mobilesdk/osx/1.7.2/module/android/android.py\", line 26, in __init__\r\nprint \"[ERROR] Couldn't find the Google APIs r%s add-on directory\" % self.sdk.DEFAULT_API_LEVEL\r\nAttributeError: AndroidSDK instance has no attribute 'DEFAULT_API_LEVEL'\r\nCreated android module project null\r\n{code}", "attachment": [], "flagged": false, "summary": "titanium.py script doesn't exit with non-zero exit code when failing to create module project", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "environment": "Mac OS X 10.7.1, Titanium mobile SDK 1.7.2,", "comment": { "comments": [ { "id": "167972", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "To test:\r\n\r\n* In your Android SDK folders, rename the add-ons/addon_google_apis_google_inc_7 folder so that it can't be found by the scripts. I.e., rename it to anything you want.\r\n* run this command in your terminal (if you're running OSX, if not please adjust the command intelligently :) -- and if your android sdk is not in /opt/android-sdk-mac_x86, you'll need to change that too in this command. Also you need to either make sure {{titanium}} is aliased to the {{titanium.py}} file in your installed 1.8.0 mobilesdk or otherwise give a complete path to it.):\r\n\r\n{code}\r\ntitanium create --type=module --platform=android --android=/opt/android-sdk-mac_86 --name=testmod --id=ti.testmod\r\n{code}\r\n\r\nYou should see an error similar to what Chris describes in the Description field of this JIRA ticket.\r\n\r\n* run {{echo $?}} to check the return value, and you'll see in the failcase that it is 0. When testing the fix, it should be 1.\r\n\r\n* Don't forget to put your add-ons/addon_google_apis_google_inc_7 folder back where it belongs when you're done testing. :)", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-10-04T19:40:38.000+0000", "updated": "2011-10-04T19:41:59.000+0000" }, { "id": "167973", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Pull request ready:\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/527", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-10-04T19:52:46.000+0000", "updated": "2011-10-04T19:52:46.000+0000" }, { "id": "176942", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.8.0.1.v20111220190134 when build fails echo $? returns 1 and when it passes it will return 0", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-21T15:28:35.000+0000", "updated": "2011-12-21T15:28:35.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }