[TIMOB-18565] Android: Support android *.aar libraries while building module
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-03-27T15:05:55.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | Android, Tooling |
Labels | aar, android, library, merge-6.1.0, module |
Reporter | Far |
Assignee | Jan Vennemann |
Created | 2015-02-12T16:44:02.000+0000 |
Updated | 2017-06-21T13:42:33.000+0000 |
Description
It will be nice to support android *.aar libraries while building module
Thanks [~msamah]
Any update on this issue?
would be so cool to have it
Hello Chee Kiat Ng. Good afternoon. Any news on this? Thanks, and best, Antonio
This is currently a hard blocker for writing an Android wrapper for https://pspdfkit.com. We managed to write Android wrappers for Xamarin, Cordova and ReactNative, however we can't write one for Titanium without this blocker being resolved. Is there any update or ETA on this ticket? Can you give us more information on TIMOB-19300? It's not accessible.
[~cng] could you please take a look here?
Nothing ?
[~rdperottoni] As you can see, this ticket is assigned and currently in progress.
PR: https://github.com/appcelerator/titanium_mobile/pull/8792
Once reviewed, would it be possible to get this back-ported to the '5_5_X' branch or '6_0_X' branch?
[~farwayer] Do you have a specific aar library you'd like us to incorporate in our testing of this? If not, we will use others, but it would be ideal to have the one(s) you will be using. Thanks.
Eric, if you don't already have a sample I'd love to work with you to try this on PSPDFKit for Android. We have quite a complex SDK with native parts (for the PDF rendering) and multiple dependencies (e.g. RxJava) so it would be a great test: https://pspdfkit.com/guides/android/current/getting-started/integrating-pspdfkit/ You can download a demo here: https://pspdfkit.com/#trynow We have a wrapper for iOS now for many years and this is a blocker for our Android-wrapper. https://pspdfkit.com/guides/android/current/other-languages/appcelerator-titanium/ We have a few customers interested in this and would love to deliver this as soon as this patch ships.
[~steipete], thanks for your help! I was able to setup and build a test module but unfortunately the most recent release is incompatible with our SDK because of differences in the targeted SDK version. Would you mind sending me version 2.7 of PSPDFKit which seems to be targeted for the same Android SDK (Marshmallow)? The demo i downloaded only contains PSPDFKit 2.9.
[~peterst], i sent you a mail and created TIMOB-24446 based on your feedback and concerns about the Support Libs. [~emerriman] should know more about any update plans for Android N.
Anymore progress in the review?
Jan is currently in the process of trying a wrapper for our aar with an older version. PSPDFKit is a big project with many dependencies and a native core - if it works for us, it will work for any aar library. I pinged Eric and N support (API 25) is also actively being worked on. Both should make it into the 6.1.0 release. There's no release date set for 6.1.0 but based on the issue tracker this seems around 80% done.
Thanks @Peter Steinberger, looking forward to testing the built master distribution once this PR is merged :)
Quick update from me: As Peter said, i'm currently testing the AAR support with PSPDFKit. Found a few issues in the current implementation, specifically with R class generation and working on fixing those.
[~gmathews], updated the PR, please feel free to review now!
Gary Mathews, curious, when can we expect this to be merged?
I pulled this branch and tried it with an AAR file from Intercom: https://github.com/intercom/intercom-android Fails in a few places. It cannot properly unzip the AAR right off the bat. I hacked in a fix there but then it can't generate the R class either.
[~brandonfuller], thank's for your feedback. The npm module used to extract the AAR files does seem to have problem with the Intercom library. I'll check that and look for alternatives. The R class generation error is most likely caused by missing dependencies or mismatching versions of the Intercom library and our bundled support library version. You can take a look at their [Dependency Graph](https://github.com/intercom/intercom-android#dependency-graph) to see which libraries you'll have to drop into your module. As you can see there, they also have a transitive dependency on the support library version 25+ but our bundled support library version is currently locked to 23.4.0 in 6.1.0, which is missing some resource identifiers the Intercom SDK uses. We are evaluating possible fixes for that issue in TIMOB-24446. Until that is solved you have to resort to the 1.x versions of the Intercom SDK which are targeted for API Level 23. It may work with an older 3.x release, but i haven't had the time to test all of them.
The Android Support Library mismatch is a problem. I've commented on TIMOB-24446 - that's a blocker for making PSPDFKit for Android on Titanium possible.
Hi Brandon, I've commented on my experience regarding the issues you are having here: https://github.com/intercom/intercom-android/issues/330 At this point I am not sure it is a Appcelerator/Hyperloop issue or more of an Intercom or just plain old library dependency issue. I'll chime in if I get past the new set of errors I am getting.
[~lchoudhary], steps to test these changes: 1. Create a new module 2. Download
shimmer-release.aar
from https://github.com/facebook/shimmer-android/releases/tag/0.1.0 and place it inside theandroid/lib
folder. 3. Add the following import to your module'sExampleProxy.java
4. Replace the content of the
ExampleView
constructor in your module'sExampleProxy.java
with the following:5. Build the module, create a new app and add the module to that app. 6. Replace the content of your app's
views/index.xml
with the following:7. Replace the content of your app's
controllers/index.js
with the following:8. Run the app. You should see the text "Awesome new feature!" with a shimmering effect applied to it.
Verified the fix. We can successfully add
.aar
libraries to the modules & access the classes as well. Closing. Studio Ver: 4.9.0.201705110256 SDK Ver: 6.1.0.v20170516134946 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.2 Appc NPM: 4.2.9 Appc CLI: 6.2.1 Ti CLI Ver: 5.0.13 Alloy Ver: 1.9.11 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: ⇨ oneplus A0001 --- Android 6.0.1Awwwesome ! Do you have any available url to download the module and test this fix ?