How to create new Android AAR in Android Studio

Multi tool use
Multi tool use


How to create new Android AAR in Android Studio



I am trying to create an Andoid AAR library to contain commonly used utility functions. I followed the instructions in https://developer.android.com/studio/projects/android-library
exactly. Namely:
1. File->New->New Module
2. Click "Android Library" then Next
3. Tried to use defaults: "My Library", "mylibrary" and SDK Version, but Finish button is grayed out and error message appeared: "The module location is inside Studio's install location."
I see no place to enter a module's location. I've tried variations on Libray name and Module name with no joy.
Am I doing something wrong?





The link you provided is about creating projects as libraries modules for your main app, to generate an aar you should look something else
– Marcos Vasconcelos
Jun 29 at 18:03





"to generate an aar you should look something else"? Hardly a useful suggestion. If you have a concrete positive suggestion, I would love to hear it.
– DontPanic
Jun 30 at 14:49




1 Answer
1



After days of unsuccessful head-banging with the IDE, I found an astoundingly simple solution in some Google results, namely:



Voila! New library app-debug.aar appears in project/app/build/outputs/aar/
I don't know where the name app-debug came from, but you can rename it afterwards if you like.



UPDATE 7/2/18



I omitted precursor steps to this procedure. They are
1. Create a base project however you normally do.
2. Delete classes and other stuff you don't need in the aar.
3. Follow the steps above.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Gi,jyOBJmUKknzxx5,AzGeoWr5HGB JI1qCIiSW y6Kmlj L6ihnBG,0CHTRvCjuuqazy7bHChhKIM vd1,37KEe
GFHIE CzGZlVJOL5LYvl48 5

Popular posts from this blog

Rothschild family

Cinema of Italy