{ "id": "165727", "key": "TIMOB-24369", "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": "19101", "name": "Hyperloop 2.1.0", "archived": false, "released": true, "releaseDate": "2017-04-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-04-08T08:41:46.000+0000", "created": "2017-02-02T09:37:39.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "bug", "hyperloop" ], "versions": [], "issuelinks": [], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-04-18T18:04:03.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 including an external AAR to an Titanium Application and trying to use it, you may face issues if it has a dependency on the v4 and v7 libs.\r\n\r\n*Steps to reproduce*:\r\n1. Create an empty Android module. This can be done on Android Studio.\r\n2. In this module, include the support v7 library in the build.gradle file:\r\n\r\n{code:java}\r\ncompile 'com.android.support:appcompat-v7:23.4.0'\r\n{code}\r\n\r\n3. Create a new class that extends from *AppCompatActivity*.\r\n4. Define this activity in your module's *AndroidManifest.xml* file.\r\n5. Build the module into an *.aar* and place it inside an Titanium project with Hyperloop.\r\n6. Inside your Titanium app, create a simple window with a button.\r\n\r\n{code:java}\r\nvar testactivity = require('com.test.ActivityTest');\r\n\r\n$.index.open();\r\n\r\nfunction onButtonClick(e) {\r\n var intent = Ti.Android.createIntent({\r\n className: 'com.test.ActivityTest',\r\n });\r\n\r\n Ti.Android.currentActivity.startActivity(intent);\r\n}\r\n{code}\r\n\r\n7. Execute the project and try launching your external activity. The error below occurs because the JS wrapper of your external activity at some point requires the *AppCompatActivity* class and can't find it.\r\n\r\n{code:java}\r\nUncaught Error: Requested module not found: ./android.support.v7.app.AppCompatActivity\r\n{code}\r\n\r\nLaunching an external activity with this method works as long as it doesn't depend on an external lib (like v4 or v7).\r\n\r\nI've tried manually adding the v4 and v7 libraries to my Titanium project, but doing so results in several errors just like this:\r\n\r\n\r\n{code:java}\r\n[ERROR] Failed to package application:\r\n[ERROR] /var/folders/1j/7_wc2wx52yzggclqvnw1wpjh0000gn/T/117029-2405-16cw5bj/res/values/attrs.xml:123: error: Attribute \"actionBarSize\" already defined with incompatible format.\r\n[ERROR] /Users/Rodolfo/Documents/Workspace/app-sandbox/build/hyperloop/android/appcompat-v7-23.4.0/res/values/values.xml:82: O\r\nriginal attribute defined here.\r\n{code}\r\n\r\n\r\nExample Titanium project and Android module attached to this ticket.", "attachment": [ { "id": "61427", "filename": "androidmodule.zip", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2017-02-02T09:37:20.000+0000", "size": 5497, "mimeType": "application/zip" }, { "id": "61428", "filename": "Example.zip", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2017-02-02T09:35:43.000+0000", "size": 153745, "mimeType": "application/zip" } ], "flagged": false, "summary": "Hyperloop Android: JS wrappers for external AAR's dependencies not generated", "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": "Titanium 6.0.1.GA\r\nHyperloop 2.0.0", "closedSprints": [ { "id": 865, "state": "closed", "name": "2017 Sprint 07 SDK", "startDate": "2017-03-26T22:01:37.741Z", "endDate": "2017-04-09T22:01:00.000Z", "completeDate": "2017-04-10T15:40:13.586Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "408219", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "Quick summary of what's happening here: If you specify a module dependency with Gradle, this dependency will not be automatically built into the module. You have put all required dependencies into your Titanium project manually. The reason why this approach fails for the appcompat library is because it's already bundled with Titanium and it tries to add the resource files from both, resulting in the described error. Hyperloop doesn't know about the bundled appcompat library and thus does not generate the JS wrappers for it.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-01T15:52:46.000+0000", "updated": "2017-03-01T15:52:46.000+0000" }, { "id": "416855", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/hyperloop.next/pull/143\r\nPR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/144", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-05T16:54:22.000+0000", "updated": "2017-04-05T16:54:22.000+0000" }, { "id": "417605", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix. No {{Requested module not found}} error seen if a module dependency with gradle is specified.\r\n\r\nClosing.\r\n\r\nStudio Ver : 4.8.1.201612050850\r\nSDK Ver : 6.0.3.GA\r\nOS Ver : 10.12.3\r\nXcode Ver : Xcode 8.3.1\r\nAppc NPM : 4.2.9\r\nAppc CLI : 6.2.0\r\nTi CLI Ver : 5.0.12\r\nAlloy Ver : 1.9.11\r\nNode Ver : 6.10.1\r\nJava Ver : 1.8.0_101\r\nHyperloop: 2.1.0", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-18T18:03:47.000+0000", "updated": "2017-04-18T18:03:47.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }