Search code examples
androidfilelicensing

Include a file when building Android AAR


I have an android project which I can already package into an AAR file using gradle. Now I want to be able to add a license file to the AAR. How can I do this?


Solution

  • Not entirely sure if it fits your needs but I would suggest you use a different solution. Instead of trying to include license information as a separate file, include license information in all of your files. That's a typical way to do it (e.g. look how Google does it in their I/O app: here or here).

    This way you will make sure the user of your library will see license information (which you cannot be sure of if you put an external license file in the aar).