{ "id": "171628", "key": "TIMOB-26037", "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": "2019-07-30T01:09:12.000+0000", "created": "2018-05-08T17:02:01.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "engTriage", "hyperloop", "websocket" ], "versions": [ { "id": "20102", "name": "Release 7.1.1", "archived": false, "released": true, "releaseDate": "2018-05-02" } ], "issuelinks": [ { "id": "57790", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "173956", "key": "TIMOB-27297", "fields": { "summary": "Android: Allow Hyperloop to access Titanium's core Java classes", "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": "Low", "id": "4" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-03-19T00:52:19.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": [], "description": "Titanium is shipping a {{java_websocket.jar}} in {{/linux/7.1.1.GA/android/}} which I can use in a normal Android module by just importing it with {{import org.java_websocket.client.WebSocketClient;}}. No need to put the jar into my project folder.\r\n\r\nWhen trying the same with Hyperloop I always get the error, that the module is not found. When placing the jar into the project folder it complains about duplicate classes.\r\n\r\nIs there a way to access the libraries inside the Android folder using Hyperloop?\r\n\r\nTitanium SDK 7.1.1.GA\r\n", "attachment": [], "flagged": false, "summary": "Hyperloop: Accessing internal WebSocket library", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 1157, "state": "closed", "name": "2019 Sprint 16", "startDate": "2019-07-29T15:35:47.313Z", "endDate": "2019-08-11T15:35:00.000Z", "completeDate": "2019-08-12T07:57:02.552Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "449568", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Devs can use our \"titanium-socketio\" module for websocket support.\r\nhttps://github.com/appcelerator-modules/titanium-socketio", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-02T21:23:52.000+0000", "updated": "2019-07-02T21:23:52.000+0000" }, { "id": "449571", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ahutton] we've tried to connect to a Websocket server (not a socket.io server!) with the Socketio module today and weren't able to do that because of `xhr poll` errors.\r\n\r\nI didn't try it but I guess the same error as in the description would appear for other modules inside the SDKs library folder (so you can't use exifinterface.jar or a support library in HL?)", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-07-02T21:42:53.000+0000", "updated": "2019-07-02T21:57:17.000+0000" }, { "id": "450060", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~michael], hyperloop currently does not support referencing Titanium's core JARs and the JARs it directly includes. It's not part of hyperloop's lookup path. And adding the WebSocket JAR to your \"modules\" directory will cause a build failure due to Java class collision (renaming the JAR file won't solve this).\r\n\r\nI think your only option is to make a native module and leverage the WebSocket JAR that Titanium already includes.\r\n\r\nIdeally, hyperloop should be changed to lookup Titanium's core JARs as well. I don't think there is any technical reason why this limitation should exist. But I don't see us doing this in the near future though.\r\n\r\nSide Note: Titanium uses web sockets for debugging.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-25T18:54:20.000+0000", "updated": "2019-07-25T19:19:27.000+0000" }, { "id": "450061", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Alternatively, you can use a command line tool to change the package names of all Java classes within the WebSocket JAR and include that in your \"modules\" directory. That would work, but it's kind of a slimy hack.\r\nhttps://stackoverflow.com/questions/13746737/hand-edit-a-jar-to-change-package-names\r\n\r\nThat said, Google has a tool that transitions JARs from the old Google Support libraries to the new AndroidX libraries. For example, their tool change references from {{android.support.v7.app.AppCompatActivity}} to {{androidx.appcompat.app.AppCompatActivity}}. So, Google sanctions hacks like this. Not quite the same for what I'm suggesting above, but if you need any justification, here it is. :P\r\nhttps://developer.android.com/jetpack/androidx/migrate\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-25T19:05:43.000+0000", "updated": "2019-07-25T19:05:43.000+0000" }, { "id": "450062", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks [~jquick] for all the details! I think the module will be the easiest way :)", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-07-25T19:10:59.000+0000", "updated": "2019-07-25T19:10:59.000+0000" }, { "id": "450147", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~michael], I wrote this up as a feature request here: [TIMOB-27297]\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-30T01:07:33.000+0000", "updated": "2019-07-30T01:07:33.000+0000" }, { "id": "454760", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~michael], as of Titanium 9.0.0 you can do this now.\r\n\r\nI recommend that you copy our \"titanium.socketio\" module's \"build.gradle\" via the link below and copy it to your project's {{./platform/android}} directory.\r\nhttps://github.com/appcelerator-modules/titanium-socketio/blob/master/android/build.gradle\r\n\r\nThis will allow hyperloop to access the Java classes you see in the below repo.\r\nhttps://github.com/socketio/socket.io-client-java\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-03-19T00:52:19.000+0000", "updated": "2020-03-19T00:52:19.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }