{ "id": "163393", "key": "TIMOB-23945", "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": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" }, { "id": "18247", "name": "Hyperloop 2.0.0", "archived": false, "released": true, "releaseDate": "2016-10-18" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-09-26T14:22:54.000+0000", "created": "2016-09-22T21:16:08.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "issuelinks": [ { "id": "53549", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "164677", "key": "TIMOB-24176", "fields": { "summary": "Hyperloop: Android - JNI libs should be included in APK", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-11-27T19:49:41.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": "10202", "name": "Android", "description": "Android Platform" }, { "id": "13715", "name": "Hyperloop", "description": "Hyperloop project" }, { "id": "10207", "name": "Tooling" } ], "description": "It's very easy to reproduce. Just add an aar file to your hyperloop enabled Titanium project. Here is the one we are using:\r\n\r\nhttps://github.com/card-io/card.io-Android-SDK/tree/master/aars\r\n\r\nThen build for android. Find the apk and unpack it. You will not see any of the aar's .so files in the lib folder, only the Titanium specific ones. This causes the use of this aar libray to fail with:\r\n\r\n[ERROR] : E/card.io : Failed to load native library: dalvik.system.PathClassLoader[DexPathList[[zip file \"/data/app/com.jasonsdeli.mobile-2/base.apk\"],nativeLibraryDirectories=[/data/app/com.jasonsdeli.mobile-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find \"libcardioDecider.so\"", "attachment": [], "flagged": false, "summary": "Hyperloop does not extract /jni//*.so files from an aar", "creator": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "environment": "Android and Hyperloop 1.2.7", "comment": { "comments": [ { "id": "396983", "author": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "body": "Also the AppC documentation states that extracting *.so files from an aar is supported. But this seems to be wrong, because it doesn't work. Here is the documentation http://docs.appcelerator.com/platform/latest/#!/guide/Android_Hyperloop_Programming_Guide-section-46253495_AndroidHyperloopProgrammingGuide-UsingThird-partylibraries", "updateAuthor": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "created": "2016-09-22T21:18:35.000+0000", "updated": "2016-09-22T21:18:35.000+0000" }, { "id": "397160", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cwilliams] I see that we do handle .so files in .aar files, but only if they are in the {{jni}} directory, is that correct? I looked at [this|https://github.com/appcelerator/hyperloop.next/blob/master/android/plugins/hyperloop/hooks/android/hyperloop.js#L403] piece of code.\r\n\r\n*EDIT*: I could happen because the provided .aar has it's .so files in {{/jni//*.so}}, so they are not \"flat\" inside there.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-24T16:55:11.000+0000", "updated": "2016-09-24T16:58:39.000+0000" }, { "id": "397162", "author": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "body": "The spec for AAR format doesn't allow for *.so to be \"flat\" inside the jni folder. See http://tools.android.com/tech-docs/new-build-system/aar-format\r\n\r\nThis means that AARs with *.so files are not supported by hyperloop until this is fixed. We need this working for a big client of yours - we are the firm building the Titanium app. Please let us know what the ETA is on this.\r\n\r\nThanks,\r\n\r\nBrian", "updateAuthor": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "created": "2016-09-24T17:07:43.000+0000", "updated": "2016-09-24T17:09:48.000+0000" }, { "id": "397163", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Actually I think the issue is something else. Because we search recursively for the files and copy them over afterwards. So maybe a duplicate file-name (if a file is found in both {{x86}} and {{x86_64}}) might cause problems. This is just some troubleshooting for now.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-24T18:11:40.000+0000", "updated": "2016-09-24T18:11:40.000+0000" }, { "id": "397164", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "*PR*: https://github.com/appcelerator/hyperloop.next/pull/77\r\n\r\n*Steps to test:*\r\n1. Create a new Hyperloop-based Titanium project: {{appc new -p android}}\r\n2. Download [card.io-5.4.1.aar|https://github.com/card-io/card.io-Android-SDK/raw/master/aars/card.io-5.4.1.aar] and copy it to {{/app/platform/android}}\r\n3. In the index.js, copy the following line to access the library:\r\n{code:javascript}\r\nvar CardIOActivity = require(\"io.card.payment.CardIOActivity\");\r\n{code}\r\n\r\n*Expected behavior:* The build does not fail, the app does not crash after requiring the class.\r\n\r\n[~btknorr] You can test the patch even before we release the next version by going to {{~/Library/Application Support/Titanium/plugins/hyperloop//hooks/android/hyperloop.js}}, and replacing the following line (around 369):\r\n{code:javascript}\r\nbuildLibs = path.join(cli.argv['project-dir'], 'build', 'libs');\r\n{code}\r\nwith\r\n{code:javascript}\r\nbuildLibs = path.join(cli.argv['project-dir'], 'build', 'android', 'libs');\r\n{code}\r\n\r\nThe generated project looks good:\r\n!https://abload.de/img/bildschirmfoto2016-09hps6z.png!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-24T18:28:37.000+0000", "updated": "2016-09-26T14:25:27.000+0000" }, { "id": "397168", "author": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "body": "Hans - I made the code modification like you suggested and everything works great now :) Thanks!", "updateAuthor": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "created": "2016-09-24T20:25:18.000+0000", "updated": "2016-09-24T20:25:18.000+0000" }, { "id": "398178", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n\r\nHyperloop now successfully extracts {{/jni//*.so}} files from an {{aar}} file.\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.8.0.201609292239\r\nTi SDK : 6.0.0.v20161005072811\r\nTi CLI : 5.0.10\r\nAlloy : 1.9.2\r\nMAC El Capitan : 10.11.6\r\nAppc NPM : 4.2.8-7\r\nAppc CLI : 6.0.0-56\r\nNode: 4.4.4\r\nNexus 5 - Android 6.0.1\r\nHyperloop plugin & module : 2.0.0", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-05T21:31:47.000+0000", "updated": "2016-10-05T21:32:16.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }