{ "id": "159501", "key": "TIMOB-23198", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-04-14T14:57:18.000+0000", "created": "2016-04-12T15:25:30.000+0000", "epic": { "id": 151897, "key": "TIMOB-19699", "name": "Android: Hyperloop for Android module", "summary": "Bring Hyperloop to Android", "color": { "key": "color_4" }, "done": false }, "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "hyperloop" ], "versions": [], "issuelinks": [ { "id": "51348", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "159579", "key": "TIMOB-23213", "fields": { "summary": "Hyperloop: Android doesn't convert char/char[]/Character", "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 } } } }, { "id": "51333", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "159431", "key": "TIMOB-23179", "fields": { "summary": "Hyperloop: Android - Java primitives arrays are wrapped in hyperloop proxies improperly", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "51473", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "159780", "key": "TIMOB-23267", "fields": { "summary": "Hyperloop: Android - Unable to call method accepting byte[] argument", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2016-07-21T20:44: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": "13715", "name": "Hyperloop", "description": "Hyperloop project" } ], "description": "When trying to instantiate BluetoothGattDescriptior \r\n\r\n\r\n{code:java}\r\nvar BGD = new BluetoothGattDescriptor();\r\n{code}\r\n\r\n\r\n\r\n\r\nthe following error log appears : \r\n{code:java}\r\n[WARN] : W/System.err: java.lang.NoSuchMethodException: []\r\n[WARN] : W/System.err: \tat java.lang.Class.getConstructor(Class.java:531)\r\n[WARN] : W/System.err: \tat java.lang.Class.getConstructor(Class.java:495)\r\n[WARN] : W/System.err: \tat hyperloop.HyperloopUtil.resolveConstructor(HyperloopUtil.java:297)\r\n[WARN] : W/System.err: \tat hyperloop.ClassProxy.newInstance(ClassProxy.java:80)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:57)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Function.handleMessage(V8Function.java:82)\r\n[WARN] : W/System.err: \tat android.os.Handler.dispatchMessage(Handler.java:98)\r\n[WARN] : W/System.err: \tat android.os.Looper.loop(Looper.java:145)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.main(ActivityThread.java:5951)\r\n[WARN] : W/System.err: \tat java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] : W/System.err: \tat java.lang.reflect.Method.invoke(Method.java:372)\r\n[WARN] : W/System.err: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)\r\n[WARN] : W/System.err: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)\r\n[WARN] : W/System.err: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0\r\n[WARN] : W/System.err: \tat hyperloop.HyperloopUtil.convert(HyperloopUtil.java:166)\r\n[WARN] : W/System.err: \tat hyperloop.ClassProxy.newInstance(ClassProxy.java:89)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:57)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Function.handleMessage(V8Function.java:82)\r\n[WARN] : W/System.err: \tat android.os.Handler.dispatchMessage(Handler.java:98)\r\n[WARN] : W/System.err: \tat android.os.Looper.loop(Looper.java:145)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.main(ActivityThread.java:5951)\r\n[WARN] : W/System.err: \tat java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] : W/System.err: \tat java.lang.reflect.Method.invoke(Method.java:372)\r\n[WARN] : W/System.err: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)\r\n[WARN] : W/System.err: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)\r\n[ERROR] : TiExceptionHandler: (main) [15625,21062] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [1,21063] - In hyperloop/android.bluetooth.BluetoothGattDescriptor.js:1,69\r\n[ERROR] : TiExceptionHandler: (main) [1,21064] - Message: Uncaught Error: length=0; index=0\r\n[ERROR] : TiExceptionHandler: (main) [1,21065] - Source: ame?arguments[0]:android.bluetooth.BluetoothGattDescriptor[\"class\"].newInstanc\r\n[ERROR] : V8Exception: Exception occurred at hyperloop/android.bluetooth.BluetoothGattDescriptor.js:1: Uncaught Error: length=0; index=0\r\n\r\n{code}\r\n\r\nOther issue is related with BluetoothGattCharacteristic, when trying to access it's methods, instantiate or cast the following error shows up:\r\n\r\n\r\n{code:java}\r\n[ERROR] : TiExceptionHandler: (main) [12908,12908] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [1,12909] - In ti:/module.js:280,9\r\n[ERROR] : TiExceptionHandler: (main) [0,12909] - Message: Uncaught Error: Requested module not found: [B\r\n[ERROR] : TiExceptionHandler: (main) [1,12910] - Source: \t\tthrow new Error(\"Requested module not found: \" + request);\r\n[ERROR] : V8Exception: Exception occurred at ti:/module.js:280: Uncaught Error: Requested module not found: [B\r\n\r\n{code}\r\n\r\n\r\n\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "Hyperloop: Android can't access fields with primitive array types", "creator": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.11.3\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 0.12.7\r\n npm Version = 2.11.3\r\nTitanium CLI\r\n CLI Version = 5.0.6\r\nTitanium SDK\r\n SDK Version = 5.4.0.v20160405023842\r\n Target Platform = android", "closedSprints": [ { "id": 618, "state": "closed", "name": "2016 Sprint 08 SDK", "startDate": "2016-04-09T00:30:18.262Z", "endDate": "2016-04-23T00:30:00.000Z", "completeDate": "2016-04-25T02:38:28.511Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "382497", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nCan you please explain a little more. Please provide a sample test case or a sample project for us to test in our environment. Also, Please provide a complete list of steps to follow. We will let you know the result ones we test the issue in our environment.\r\n\r\nRegards,\r\nSharif.\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-04-12T16:53:12.000+0000", "updated": "2016-04-12T16:53:12.000+0000" }, { "id": "382499", "author": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "body": "in any app.js with hyperloop 1.1.2:\r\n\r\n\r\n{code:java}\r\nvar BluetoothGattDescriptor = require('android.bluetooth.BluetoothGattDescriptor');\r\nvar BluetoothGattCharacteristic = require('android.bluetooth.BluetoothGattCharacteristic');\r\nvar UUID = require('java.util.UUID');\r\n\r\n\r\n// test 1\r\nvar BGD = new BluetoothGattDescriptor(UUID.fromString(\"E20A39F4-73F5-4BC4-A12F-17D1AD07A961\"),0);\r\n\r\n\r\n\r\n\r\n// test2\r\nvar BGD = new BluetoothGattDescriptor();\r\n\r\n//test3\r\nvar characteristic = new BluetoothGattCharacteristic();//-> this one is not instantiated as it should, but it's enough to reproduce\r\n{code}\r\n\r\nIf further information is needed the reproducible test case is more complex.", "updateAuthor": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-12T17:12:06.000+0000", "updated": "2016-04-12T17:12:06.000+0000" }, { "id": "382525", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey [~bgarcia], did that work before? [~cwilliams] any idea what could cause this?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-12T20:04:52.000+0000", "updated": "2016-04-12T20:04:52.000+0000" }, { "id": "382570", "author": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi @Hans Knoechel, with other classes it works properly. Another issue that I've detected is that when calling BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE it return undefined. ", "updateAuthor": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-13T07:06:53.000+0000", "updated": "2016-04-13T07:08:06.000+0000" }, { "id": "382618", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "The second error message about the require failing for \"[B\" is the same error that caused TIMOB-23179 - we were improperly trying to wrap arrays in hyperloop proxies rather than letting the kroll bridge translate the array in a JS array. So that issue should now be fixed in master branch of the module.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-04-13T17:00:05.000+0000", "updated": "2016-04-13T17:00:05.000+0000" }, { "id": "382621", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "So I believe that this is fixed now (likely by my recent fixes?). Here's what I tried:\r\n{code:javascript}\r\nvar BluetoothGattDescriptor = require('android.bluetooth.BluetoothGattDescriptor'),\r\n\tBluetoothGattCharacteristic = require('android.bluetooth.BluetoothGattCharacteristic'),\r\n\tUUID = require('java.util.UUID');\r\n\r\n// test 1\r\nvar BGD = new BluetoothGattDescriptor(UUID.fromString(\"E20A39F4-73F5-4BC4-A12F-17D1AD07A961\"), 0);\r\nconsole.log(JSON.stringify(BGD));\r\nconsole.log(BGD.getPermissions());\r\nconsole.log(BGD.getUuid().toString());\r\nvar char = BGD.getCharacteristic();\r\nconsole.log(JSON.stringify(char));\r\n{code}\r\n\r\nThat ran fine and spit out:\r\n{code}\r\n[DEBUG] Module: Loading module: hyperloop/java.util.UUID -> Resources/hyperloop/java.util.UUID.js\r\n[INFO] {\"$native\":{\"isInstanceProxy\":true,\"bubbleParent\":true,\"rect\":{\"height\":0,\"width\":0,\"y\":0,\"x\":0},\"children\":[],\"keepScreenOn\":false,\"size\":{\"height\":0,\"width\":0,\"y\":0,\"x\":0},\"isNativeProxy\":true,\"apiName\":\"android.bluetooth.BluetoothGattDescriptor\"},\"_hasPointer\":true,\"_private\":{}}\r\n[INFO] 0\r\n[INFO] e20a39f4-73f5-4bc4-a12f-17d1ad07a961\r\n[INFO] null\r\n{code}\r\n\r\nThe fixes are available on master builds of the hyperloop.next module, I used the zip from https://jenkins.appcelerator.org/job/hyperloop-next/35/artifact/dist/hyperloop-1.1.2.zip\r\n\r\nI don't know when we plan to push out new versions of the module externally so users can also try it...", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-04-13T17:12:29.000+0000", "updated": "2016-04-13T17:12:29.000+0000" }, { "id": "382624", "author": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Chris, Could you try the return of BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE? \r\n\r\nHow can I download that build? Just to check if I can go forward on the example I want to implement. Thanks!", "updateAuthor": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-13T17:30:26.000+0000", "updated": "2016-04-13T17:30:26.000+0000" }, { "id": "382627", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Ah, that still fails. Let me look.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-04-13T17:43:30.000+0000", "updated": "2016-04-13T17:43:30.000+0000" }, { "id": "382632", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "As far as when we'll release a new version of the module, I'm talking to [~hansknoechel] about that now.\r\n\r\nFor the issue around BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE - that looks to be because when we retrieve fields of a class through reflection we can get primitive arrays back - rather than the boxed types (i.e. byte[] vs Byte[]). Whereas with method reflection I think we always get boxed types - even with arrays. So I needed to add the full list of primitive array types into the \"whitelist\" of types not to wrap in special hyperloop proxies and allow the bridge to translate to JS. There's also some extra hoops around the act that our bridge seems to handle every primitive array type except byte[], so I'll need to special case byte[] to make it a short[] first.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-04-13T18:18:24.000+0000", "updated": "2016-04-13T18:18:24.000+0000" }, { "id": "382634", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "OK, I've got a quick fix in a PR:\r\nhttps://github.com/appcelerator/hyperloop.next/pull/16", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-04-13T18:27:05.000+0000", "updated": "2016-04-13T18:27:05.000+0000" }, { "id": "391234", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. Verified that I was able to access fields with primitive array types; used above sample code and tried with {{BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE}}.\r\n\r\n*However,* I did encounter a {{Uncaught RangeError: Maximum call stack size exceeded}} runtime error when you try to stringify an object instance i.e. {{console.log(JSON.stringify(BGD));}}. Will file another ticket for this issue.\r\n\r\nTested on:\r\n\r\nAppc CLI NPM: 4.2.7\r\nAppc CLI Core: 5.4.0-33\r\nArrow: 1.8.2\r\nSDK: 5.4.0.v20160720201924\r\nHyperloop: 1.2.3\r\nNode: v4.4.7\r\nOS: Mac OS X (10.11.5)\r\nDevices: Samsung Galaxy S5 (4.4.2), Genymotion Emulator (5.1.0)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-21T20:07:40.000+0000", "updated": "2016-07-21T20:07:40.000+0000" }, { "id": "391235", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~wluu] I guess that is not really an issue, because logging it would try to print all of its attributes etc which causes the app to run out of memory. It's not really a common use-case, but file it anyway so we can discuss it there. [~cwilliams] will know best", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-21T20:27:12.000+0000", "updated": "2016-07-21T20:27:12.000+0000" }, { "id": "391241", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel], Agreed. So instead, I wrote a an improvement ticket to have a meaningful error message similar to iOS: TIMOB-23672", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-21T20:44:04.000+0000", "updated": "2016-07-21T20:44:04.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }