{ "id": "163243", "key": "TIMOB-23933", "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": "20070", "description": "", "name": "Hyperloop 3.0.2", "archived": false, "released": true, "releaseDate": "2018-02-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-01-31T19:45:26.000+0000", "created": "2016-09-16T00:47:18.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "hyperloop", "json" ], "versions": [], "issuelinks": [], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-02-05T16:53:27.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": "I'm trying to import the lib *org.json* into a Hyperloop project by placing it inside *app/platform/android*. The lib is contained inside a *jar* file.\r\n\r\nI'm building my project and somehow the JS wrappers for this lib are not being generated.\r\nAt first I thought jars were not supported, but then I saw that the Hyperloop examples project is using a *.jar* (volley.jar) without any problems.\r\n\r\nI've attached the .jar with the mentioned lib so you can try and reproduce the same error.\r\n", "attachment": [ { "id": "60296", "filename": "json.jar", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2016-09-21T04:01:09.000+0000", "size": 84697, "mimeType": "application/java-archive" } ], "flagged": false, "summary": "Hyperloop - Android: JS Wrappers not being generated for org.json .JAR", "creator": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "subtasks": [], "reporter": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "environment": "Hyperloop 1.2.7\r\nTi SDK 5.5.0.GA", "comment": { "comments": [ { "id": "396430", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We cannot work with this ticket at this moment. Please provide:\r\n- full trace-log\r\n- reproducible example-code\r\n- related jar-file", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-17T11:06:40.000+0000", "updated": "2016-09-17T11:06:40.000+0000" }, { "id": "396766", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "body": "Hey Hans. Sorry for the bad description. I must've had a bad day when I wrote this ticket and didn't notice how poorly described it was.\r\n\r\n* Full trace log is not necessary in this case - there is no error.\r\n* Jar file is attached. Example will be provided in the next comment.", "updateAuthor": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2016-09-21T04:02:34.000+0000", "updated": "2016-09-21T04:02:34.000+0000" }, { "id": "396767", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "body": "{code:java}\r\nvar OAuth = require('io.oauth.OAuth'),\r\n OAuthCallback = require('io.oauth.OAuthCallback'),\r\n Activity = require('android.app.Activity'),\r\n OAuthJSONCallback = require('io.oauth.http.OAuthJSONCallback'),\r\n callbackOauth, oauth;\r\n\r\n$.getView().activity.onResume = function() {\r\n oauth = new Activity($.getView().activity);\r\n oauth.initialize('BOYep66tMyWO46oe5Q7B8l9odaQ');\r\n\r\n callbackOauth = new OAuthCallback({\r\n onFinished: function(data) {\r\n if (data.status == \"error\") {\r\n alert('oops');\r\n } else {\r\n // Retrieves the user informations\r\n var callback = OAuthJSONCallback.extend({\r\n onFinished: function(me) {\r\n Ti.API.error(me);\r\n },\r\n onError: function(message) {\r\n Ti.API.error(message);\r\n }\r\n });\r\n\r\n data.me(new callback());\r\n }\r\n }\r\n });\r\n\r\n oauth.popup(\"google\", callbackOauth);\r\n\r\n}\r\n\r\n\r\n{code}\r\n", "updateAuthor": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2016-09-21T04:21:08.000+0000", "updated": "2016-09-21T04:24:22.000+0000" }, { "id": "401680", "author": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It fails also with SDK 6.0.0 and Hyperloop 2.0. Requiring \r\n{code:javascript}\r\n('org.json.JSONObject') \r\n{code}\r\ndoes not generate the proper files", "updateAuthor": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-22T10:36:41.000+0000", "updated": "2016-11-22T10:36:41.000+0000" }, { "id": "403211", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~gmathews] I just noticed that we have [this line|https://github.com/garymathews/hyperloop.next/blob/c704f700041b3ea665188c86cf681774320e67d7/android/plugins/hyperloop/hooks/android/metabase/metabase.js#L75] in our metabase. Could that be something hardcoded that prevents us from adding the {{json.jar}} manually?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-12T21:00:02.000+0000", "updated": "2016-12-12T21:00:02.000+0000" }, { "id": "403261", "author": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi, \r\n\r\nfor me, replacing line 66 in JavaMetabaseGenerator.java with this:\r\n{code:java}\r\nif (((filename.endsWith(\"android.jar\")/* && whitelist.matcher(entry).find()*/) || true)/* && !blacklist.matcher(entry).find() */&& isClass.matcher(entry).find())\r\n{code}\r\n\r\ndoes the trick and the bindings for json.jar are generated. ", "updateAuthor": { "name": "bgarcia", "key": "bgarcia", "displayName": "Brian García", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-13T11:59:34.000+0000", "updated": "2016-12-13T11:59:34.000+0000" }, { "id": "433598", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/hyperloop.next/pull/268", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-24T18:38:42.000+0000", "updated": "2018-01-24T18:38:42.000+0000" }, { "id": "433978", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~lchoudhary], follow these steps to validate this ticket:\r\n\r\n# Place the attached {{json.jar}} under {{platform/android}}\r\n# Add the following code to use the JSON library: \r\n{code}\r\nvar JSONObject = require('org.json.JSONObject');\r\nvar data = new JSONObject();\r\ndata.put('foo', 'bar');\r\ndata.put('solution', 42);\r\nconsole.log('JSON string: ' + data.toString());\r\n{code}\r\n# Run the app\r\n\r\n*Expected behavior*\r\nThe build succeeds and the app starts without any errors. The following string should be printed to the logs:\r\n{code}\r\n[INFO] JSON string: {\"foo\":\"bar\",\"solution\":42}\r\n{code}", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-02T18:47:59.000+0000", "updated": "2018-02-02T18:47:59.000+0000" }, { "id": "434053", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix with hyperloop 3.0.2.\r\n\r\nClosing.\r\n\r\nStudio Ver: 5.0.0.201712081732\r\nSDK Ver: 7.0.2.v20180201155017\r\nOS Ver: 10.13.2\r\nXcode Ver: Xcode 9.2\r\nAppc NPM: 4.2.11\r\nAppc CLI: 7.0.2-master.7\r\nDaemon Ver: 1.0.1\r\nTi CLI Ver: 5.0.14\r\nAlloy Ver: 1.10.12\r\nNode Ver: 8.9.1\r\nNPM Ver: 5.5.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ google Nexus 5 --- Android 6.0.1\r\n ⇨ google Pixel --- Android 7.1.1\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-02-05T16:53:20.000+0000", "updated": "2018-02-05T16:53:20.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }