Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18565] Android: Support android *.aar libraries while building module

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-03-27T15:05:55.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0
ComponentsAndroid, Tooling
Labelsaar, android, library, merge-6.1.0, module
ReporterFar
AssigneeJan Vennemann
Created2015-02-12T16:44:02.000+0000
Updated2017-06-21T13:42:33.000+0000

Description

It will be nice to support android *.aar libraries while building module

Comments

  1. Chee Kiat Ng 2015-10-27

  2. Rakhi Mitro 2016-03-07

    Thanks [~msamah]
  3. Michael Gangolf 2016-06-08

    Any update on this issue?
  4. Carlos Henrique Zinato 2016-06-08

    would be so cool to have it
  5. Francisco Antonio Duran Ramirez 2016-06-10

    Hello Chee Kiat Ng. Good afternoon. Any news on this? Thanks, and best, Antonio
  6. Peter Steinberger 2016-11-09

    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.
  7. Ingo Muschenetz 2016-11-28

    [~cng] could you please take a look here?
  8. Rodolfo Perottoni 2017-01-05

    Nothing ?
  9. Hans Knöchel 2017-01-05

    [~rdperottoni] As you can see, this ticket is assigned and currently in progress.
  10. Jan Vennemann 2017-02-07

    PR: https://github.com/appcelerator/titanium_mobile/pull/8792
  11. Muhammad Ahmed Fahad 2017-02-13

    Once reviewed, would it be possible to get this back-ported to the '5_5_X' branch or '6_0_X' branch?
  12. Eric Merriman 2017-02-27

    [~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.
  13. Peter Steinberger 2017-02-27

    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.
  14. Jan Vennemann 2017-03-01

    [~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.
  15. Peter Steinberger 2017-03-01

  16. Jan Vennemann 2017-03-02

    [~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.
  17. Muhammad Ahmed Fahad 2017-03-07

    Anymore progress in the review?
  18. Peter Steinberger 2017-03-07

    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.
  19. Muhammad Ahmed Fahad 2017-03-07

    Thanks @Peter Steinberger, looking forward to testing the built master distribution once this PR is merged :)
  20. Jan Vennemann 2017-03-07

    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.
  21. Jan Vennemann 2017-03-23

    [~gmathews], updated the PR, please feel free to review now!
  22. Muhammad Ahmed Fahad 2017-03-28

    Gary Mathews, curious, when can we expect this to be merged?
  23. Brandon Fuller 2017-04-02

    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.
  24. Jan Vennemann 2017-04-04

    [~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.
  25. Peter Steinberger 2017-04-04

    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.
  26. Brandon Fuller 2017-04-05

  27. Matias Penela 2017-04-05

    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.
  28. Brandon Fuller 2017-04-05

  29. Jan Vennemann 2017-05-10

    [~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 the android/lib folder. 3. Add the following import to your module's ExampleProxy.java
        import android.app.Activity;
        import android.graphics.Color;
        import android.view.Gravity;
        import android.view.ViewGroup.LayoutParams;
        import android.widget.TextView;
        import com.facebook.shimmer.ShimmerFrameLayout;
        
    4. Replace the content of the ExampleView constructor in your module's ExampleProxy.java with the following:
        super(proxy);
        
        Activity activity = proxy.getActivity();
        TextView textView = new TextView(activity);
        textView.setText("Awesome new feature!");
        textView.setTextSize(32);
        textView.setTextColor(Color.parseColor("#FFFFFF"));
        ShimmerFrameLayout shimmer = new ShimmerFrameLayout(activity);
        shimmer.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        shimmer.setDuration(1000);
        shimmer.addView(textView);
        shimmer.startShimmerAnimation();
        setNativeView(shimmer);
        
    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:
        <Alloy>
        	<Window title="Shimmer" backgroundColor="#232E3F">
        		<View class="vbox" id="shimmerContainer"></View>
        	</Window>
        </Alloy>
        
    7. Replace the content of your app's controllers/index.js with the following:
        var mod = require('<your.module.id>');
        $.shimmerContainer.add(mod.createExample());
        
        $.index.open();
        
    8. Run the app. You should see the text "Awesome new feature!" with a shimmering effect applied to it.
  30. Lokesh Choudhary 2017-05-16

    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.1
  31. Ricardo Ramirez 2017-05-16

    Awwwesome ! Do you have any available url to download the module and test this fix ?

JSON Source