'How include license to jar file in android library (aar)
Solution 1:[1]
if you want add LICENSE.txt into your android library (aar). you should do two things:
- add your LICENSE.txt to your project, path: src/main/resources/META-INF(other resources folders are acceptable as well)
- add "android {packagingOptions{ merge '**/LICENSE.txt'}" into your xxx(sdkname)/build.gradle file.
the keyword merge means add all matching files to your aar
Solution 2:[2]
here is the jar document describes:
JAR file is a file format based on the popular ZIP file format and is used for aggregating many files into one. A JAR file is essentially a zip file that contains an optional META-INF directory
the META_INF function is that:
The META-INF directory, if it exists, is used to store package and extension configuration data, including security, versioning, extension, and services.
so I think you should put it int the META_INF files. you can see this answer get some solution.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Chentao Zhou |
| Solution 2 |

