{ "id": "165218", "key": "TIMOB-24284", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2017-04-07T19:15:37.000+0000", "created": "2017-01-06T20:01:38.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [ { "id": "54657", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "162033", "key": "TIMOB-23679", "fields": { "summary": "Hyperloop-examples: GLCalendarView delegate crashes on iOS device", "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": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-05-31T23:19:01.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": "13715", "name": "Hyperloop", "description": "Hyperloop project" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Hyperloop.defineClass() method is preventing my app from building with an uncaught exception during build/deploy to device or simulator.\r\n\r\nIn the log output I get:\r\n\r\n\r\n{code:java}\r\n[INFO] Processing JavaScript files\r\nAn uncaught exception was thrown!\r\nHyperloop.defineClass must return a class definition into a variable\r\n{code}\r\n\r\n\r\nI just did a File -> New Mobile App in Appcelerator Studio and added 1 line to \"index.js\"\r\n\r\n\r\n{code:javascript}\r\nvar myFoo = Hyperloop.defineClass('MyFoo', 'NSObject');\r\n\r\nfunction doClick(e) {\r\n alert($.label.text);\r\n}\r\n\r\n$.index.open();\r\n{code}\r\n\r\nI also have\r\n\r\n{code:javascript}\r\ntrue\r\n{code}\r\n\r\nadded in my tiapp.xml\r\n\r\nno other changes from the default \"new project\" template in Appc Studio.\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "Hyperloop: iOS - Hyperloop.defineClass fails when subclassing NSObject", "creator": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "subtasks": [], "reporter": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "environment": "Mac OSX 10.11.6\r\nTitanium SDK 6.0.1.GA\r\nAlloy 1.9.5\r\nHyperloop 2.0.0\r\nAppcelerator Studio 4.8.1.201612050850\r\niOS SDK 10.2\r\nXcode 8.2.1\r\n", "comment": { "comments": [ { "id": "404234", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, In what platform are you running? I tested in Android. I was not able to reproduce the issue following your guide. Am I missing something? ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-01-07T05:05:57.000+0000", "updated": "2017-01-07T05:05:57.000+0000" }, { "id": "404237", "author": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "body": "iOS SDK 10.2\r\nXcode 8.2.1\r\n\r\nIt's failing for me building for the iPad Air 2 simulator, and also failing for an actual iPad Air 2 device connected via USB.", "updateAuthor": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "created": "2017-01-07T16:04:02.000+0000", "updated": "2017-01-07T16:04:41.000+0000" }, { "id": "404242", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ksouthworth] Does this only happen when you subclass {{NSObject}} or also other classes like {{UIView}}? And does it help to require {{NSObject}} before, as a workaround (e.g. {{var NSObject = require('Foundation/NSObject');}})?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-08T21:03:05.000+0000", "updated": "2017-01-08T21:03:05.000+0000" }, { "id": "404284", "author": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "body": "@Hans Knoechel I tried requiring NSObject first as you suggested, still get the same error. Tried subclassing from UIView as well, but also still get the same error.", "updateAuthor": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "created": "2017-01-09T14:38:32.000+0000", "updated": "2017-01-09T14:38:32.000+0000" }, { "id": "404354", "author": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "updateAuthor": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "created": "2017-01-10T15:52:22.000+0000", "updated": "2017-01-10T15:52:22.000+0000" }, { "id": "404358", "author": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "body": "In Appcelerator Studio, with an actual iOS device selected in the run/build menu:\r\n\r\nChoosing \"Run\" and clicking the green play button: custom hyperloop class implementation is EMPTY\r\n\r\nChoosing \"Debug\" and clicking the green play button: custom hyperloop class implementation is FILLED-IN and works correctly!\r\n\r\n(I was opening the generated .xcodeproject file and looking under Hyperloop / Custom / custom.m)\r\n\r\nSo seems to be something going on depending on the {{--deploy-type}} flag during compilation for actual iOS devices??\r\n\r\nIt also *fails* when I use the CLI and try to package up for iOS adhoc distribution using:\r\n{{ti build --platform ios --target dist-adhoc}}\r\n", "updateAuthor": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "created": "2017-01-10T16:14:54.000+0000", "updated": "2017-01-10T16:14:54.000+0000" }, { "id": "407476", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ksouthworth], please see my comment in TIMOB-23679 for an explanation for the error you are seeing. The only way to workaround this currently is to use the {{--skip-js-minify}} flag for device builds.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-21T13:42:22.000+0000", "updated": "2017-02-21T13:42:22.000+0000" }, { "id": "417055", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Duplicate of TIMOB-23679.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-07T19:15:37.000+0000", "updated": "2017-04-07T19:15:37.000+0000" }, { "id": "420738", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-31T23:19:01.000+0000", "updated": "2017-05-31T23:19:01.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }