Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thank you, this definitively works. As for the part of my question: I want to use this jar as source code in Android Studio. Is this possible while having it inside the libs directory inside the aar? I realize now that this may not be the proper approach. Having the jar file externally and selecting that as source in Android Studio works, but it is only possible to select jar and zip files for sources, not aar files. Commented Feb 28, 2017 at 9:27
  • I don't know if you can use the jar as source code in Android Studio as you describe. I am not sure exactly what you're doing but if I were developing an aar I would expect some people to want the jar with classes if they just want to use the functionality in your library, and other people would want the source if they want to change it. I wouldn't think users would want BOTH. So I would distribute separate artifacts, one of the source and one of the aar. Commented Feb 28, 2017 at 16:20
  • I ended up distributing the jar with sources separately. It seems that this is what Android Studio expects. If I open the decompiled sources from the aar, it is possible to click Attach Sources in the top right corner and select the jar. It seems like this is the "correct" way of doing this, and I cannot find any documentation to include it in the aar anywhere. Commented Mar 4, 2017 at 9:37