Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAR with .a and .h #261

Closed
igagis opened this issue Jul 21, 2016 · 15 comments
Closed

AAR with .a and .h #261

igagis opened this issue Jul 21, 2016 · 15 comments

Comments

@igagis
Copy link

igagis commented Jul 21, 2016

Is it possible to create AAR containing prebuilt static library and header files?

@davinctor
Copy link

davinctor commented Jul 21, 2016

@igagis as said @ggfan is this thread - mapBox can use .arr and contains static library

@ggfan
Copy link
Contributor

ggfan commented Jul 22, 2016

No is easy answer, internal bug is b/28395014 [the feature is not on priority though]

Probably indirectly [tried with shared lib once a while ago], and I personally do not think it is worthwhile:

  • build your lib first to generate a static lib, and one aar [model.library does not tuck *.a into libs directory though]
  • unzip your aar, and put *.a into libs folder
  • find a place for your headers file
  • zip it up back to aar

inside your app, make aar to be your dependent lib, so it will be extracted into exploded-aar folder; then the colorful picture appears:

  • add the intermediate explodeded aar directory into include path
    I think it is too hacky and may not be a good idea to impose those into your customers.

traditional way of distributing lib and header files directly is still better, comparing to the above hacking.
For building libs, cmake way is much better, checkout hello-libs in master-cmake branch, hope this helps

@igagis
Copy link
Author

igagis commented Jul 22, 2016

@ggfan thanks for your explanation!

Unfortunately, distributing lib and header files directly is not an option for me. I have a rather complex structure of several libraries which depend on each other. So, managing all those by hand, especially if version of one changes and needs updating is terrible.

It is bad that Android lacks native library management. On iOS one can manage by using cocoapods, but there is no similar thing for Android environment...

Hope b/28395014 will be prioritized at some point...

@ggfan
Copy link
Contributor

ggfan commented Jul 23, 2016

thank you @igagis, added your comment into internal issue and hope it will be addressed

@ggfan
Copy link
Contributor

ggfan commented Aug 30, 2016

is your application + library on github or somewhere, @igagis ? like to see how you solve your dependencies if you are building multiple native libs.

@igagis
Copy link
Author

igagis commented Aug 31, 2016

@ggfan I didn't solve the problem, so I just do not do it right now on Android.

@ggfan
Copy link
Contributor

ggfan commented Aug 31, 2016

ok, understood. are you saving your source on github?

@igagis
Copy link
Author

igagis commented Aug 31, 2016

@ggfan yes, you can view all my repos in my github profile

@ggfan
Copy link
Contributor

ggfan commented Aug 31, 2016

thanks!

@ggfan
Copy link
Contributor

ggfan commented Sep 1, 2016

Adding @jomof

@ggfan
Copy link
Contributor

ggfan commented Oct 5, 2016

@igagis: may you kindly send a summary about your intended usage of AAR for native distribution: you could use my email gfan@google.com, I will pass to Jomo & Kathryn ( not exposing their email by me here :-)).

@igagis
Copy link
Author

igagis commented Oct 6, 2016

@ggfan ok, I have sent you an email

@ggfan
Copy link
Contributor

ggfan commented Oct 6, 2016

@igagis: thank you very much! I will close this one from here and leave its normal channel for update if something happens

@igagis
Copy link
Author

igagis commented Apr 27, 2017

I made a hacky solution to the problem, described here http://stackoverflow.com/a/43661627/1221106

@ggfan
Copy link
Contributor

ggfan commented Apr 27, 2017

Adding @rschiu @jomof

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants