{ "id": "166502", "key": "TIMOB-24466", "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": null, "resolutiondate": null, "created": "2017-03-08T17:51:10.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "18247", "name": "Hyperloop 2.0.0", "archived": false, "released": true, "releaseDate": "2016-10-18" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:09.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "*Steps to reproduce the behavior*\r\n1. Create a Hyperloop enabled classic project\r\n2. Drop the attached .aar that contains resources into {{platform/android}} folder\r\n3. Add the following code to {{Resources/app.js}}\r\n{code}\r\nvar R = require('com.example.testlibrary.R');\r\nvar helloText = currentActivity.getString(R.string.hello_world);\r\nTi.API.debug(helloText);\r\n{code}\r\n\r\n*Actual behavior*\r\nThe following error is thrown\r\n{code}\r\n[ERROR] TiExceptionHandler: (main) [107,107] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] TiExceptionHandler: (main) [0,107] - In ti:/module.js:303,2\r\n[ERROR] TiExceptionHandler: (main) [0,107] - Message: Uncaught Error: Requested module not found: com.example.testlibrary.R\r\n[ERROR] TiExceptionHandler: (main) [0,107] - Source: \tthrow new Error(\"Requested module not found: \" + request); // TODO Set 'code' property to 'MODULE_NOT_FOUND' to match Node?\r\n[ERROR] V8Exception: Exception occurred at ti:/module.js:303: Uncaught Error: Requested module not found: com.example.testlibrary.R\r\n{code}\r\n\r\n*Expected behavior*\r\nThe string \"Hello World!\" should be printed to debug log.\r\n\r\n*Additional notes*\r\nThis is kind of an edge use-case and only occurs if you want to access the specific R class from an .aar file. The library itself still works because AAPT will create a new R class which contains the resource ids from the App and all .aar files. The same issue occurs if two .aar files depend on each other and use the other one's R class.\r\n\r\nTIMOB-18565 introduces AAR handling for Ti modules which includes code that will generated the missing R files. The code from there should be reused and also be applied to Hyperloop.", "attachment": [ { "id": "61805", "filename": "testlibrary-debug.aar", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-08T17:51:07.000+0000", "size": 15582, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "Hyperloop: Android - R classes not generated from AAR", "creator": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "environment": "TiSDK 6.0.2.GA\r\nHyperloop 2.0.0", "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }