{ "id": "173008", "key": "TIMOB-26830", "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": "20780", "name": "Hyperloop 4.0.2", "archived": false, "released": true, "releaseDate": "2019-03-11" } ], "resolution": null, "resolutiondate": null, "created": "2019-02-15T14:41:48.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "20445", "description": "", "name": "Hyperloop 4.0.1", "archived": false, "released": true, "releaseDate": "2019-01-17" } ], "issuelinks": [], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2019-04-22T15:48:22.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" }, { "id": "13715", "name": "Hyperloop", "description": "Hyperloop project" } ], "description": "I'm experiencing what I believe is a bug in the Hyperloop in Android only. We have multiple apps that share a similar codebase. We have a lot of this code in one directory and we \r\nsymlink it to all of the other projects. If I use Hyperloop in a file that lives inside this symlinked directory to require a class it throws an error during build. If I run the project that contains the actual directory, not just a symlink, it works just fine. \r\n\r\nThe error I'm seeing. \r\n\r\n{code:title error}\r\n[ERROR] : TiExceptionHandler: (main) [228,228] ti:/module.js:303\r\n[ERROR] : TiExceptionHandler: \tthrow new Error('Requested module not found: ' + request); // TODO Set 'code' property to 'MODULE_NOT_FOUND' to match Node?\r\n[ERROR] : TiExceptionHandler: ^\r\n[ERROR] : TiExceptionHandler: Error: Requested module not found: android.view.View\r\n[ERROR] : TiExceptionHandler: at Module.require (ti:/module.js:303:8)\r\n[ERROR] : TiExceptionHandler: at Module.global.Module.require (/ti.internal/extensions/binding.js:33:34)\r\n[ERROR] : TiExceptionHandler: at require (ti:/module.js:570:15)\r\n[ERROR] : TiExceptionHandler: at /shared/Example.js:1:102\r\n[ERROR] : TiExceptionHandler: at Module._runScript (ti:/module.js:612:9)\r\n[ERROR] : TiExceptionHandler: at Module.load (ti:/module.js:108:7)\r\n[ERROR] : TiExceptionHandler: at Module.loadJavascriptText (ti:/module.js:457:9)\r\n[ERROR] : TiExceptionHandler: at Module.loadAsFile (ti:/module.js:512:15)\r\n[ERROR] : TiExceptionHandler: at Module.loadAsFileOrDirectory (ti:/module.js:429:20)\r\n[ERROR] : TiExceptionHandler: at Module.require (ti:/module.js:262:17)\r\n[ERROR] : TiExceptionHandler:\r\n[ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)\r\n[ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:162)\r\n[ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollRuntime.runModule(KrollRuntime.java:207)\r\n[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.loadScript(TiLaunchActivity.java:97)\r\n[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.loadScript(TiRootActivity.java:414)\r\n[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:174)\r\n[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:283)\r\n[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:767)\r\n[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:167)\r\n[ERROR] : TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:260)\r\n[ERROR] : V8Exception: Exception occurred at ti:/module.js:303: Uncaught Error: Requested module not found: android.view.View\r\n{code}\r\n\r\nThe class I'm requiring in the call stack is a third-party AAR that is in my platform/android directory, but it still throws an error when requiring a default android class like android.view.View. \r\n\r\nI also noticed that in build/hyperloop/android/js, it builds a corresponding js file for every needed android class, but when the require is inside a symlinked directory the necessary file doesn't get generated. I figured as a workaround I could require the \r\nclass in a file that is not symlinked so it would generate the bindings needed and then I would be able to require it again in the symlinked directory, but this was not the case and it still threw an error. \r\n\r\nHere's roughly what our directory structure looks like: \r\n\r\nApp1 \r\n/Resources \r\n/app1code \r\n/shared \r\n\r\nApp2 \r\n/Resources \r\n/app2code \r\n/shared <- this is a symlink to App1/shared, requiring an android class in here causes an error \r\n\r\n*Steps To Reproduce:*\r\n1. Just create two new projects manually. \r\n2. Pase this code in app.js file for both App.\r\n{code}\r\nvar tabGroup = Ti.UI.createTabGroup();\r\nvar Example = require('/shared/Example');\r\n{code}\r\n\r\n3. Then create a directory called \"shared\" in one app and take the attached \"Example.js\" file\r\nand put it in the \"shared\" directory. \r\n4. Then symlink that directory in the\r\nother project using 'ln -s /path/to/shared /path/to/symlink'. That's all I\r\ndid. \r\n5. Now run those Apps.\r\n6. First App is working perfectly.\r\n7. Second App is throwing an error.\r\n\r\n\r\nAgain, this does not seem to be an issue on iOS, only Android.", "attachment": [ { "id": "66166", "filename": "Example.js", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2019-02-15T14:42:51.000+0000", "size": 94, "mimeType": "text/javascript" } ], "flagged": false, "summary": "Hyperloop: Android - Can not read java class from the symlink directory folder", "creator": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "Ti SDK 7.5.0.GA, 8.0.0.X\r\nHyperloop Version: 4.0.1, 3.1.4", "closedSprints": [ { "id": 1118, "state": "closed", "name": "2019 Sprint 5", "startDate": "2019-02-24T18:36:06.435Z", "endDate": "2019-03-08T18:36:00.000Z", "completeDate": "2019-03-07T22:19:47.057Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "446329", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/hyperloop.next/pull/319", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-26T20:56:23.000+0000", "updated": "2019-02-26T20:56:23.000+0000" }, { "id": "446830", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "They can already get the latest Hyperloop build which contains the fix here: https://github.com/appcelerator-modules/hyperloop-builds/releases\r\n\r\nIt will be shipped with SDK 8.0.0.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-03-14T14:51:38.000+0000", "updated": "2019-03-14T14:51:38.000+0000" }, { "id": "446836", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Thanks for your great effort.", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2019-03-14T16:09:11.000+0000", "updated": "2019-03-14T16:09:11.000+0000" }, { "id": "447826", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The ticket is already merged. QE to test before closing.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-22T15:48:22.000+0000", "updated": "2019-04-22T15:48:22.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }