Two Ways for Android to Refer to arr Packages
- 2021-10-16 05:06:39
- OfStack
Package 1 referenced in android is generally divided into two types:
1. jar package
2. arr package
The arr package actually comes with the jar package of res, while the ordinary jar package does not come with a resource file. So how do you reference it in your project?
1. Copy the arr package to the libs directory
2. Add a local repository to the build. gradle file, and use the libs directory as the repository address.
repositories {flatDir {dirs 'libs'}}
android{
.
.
.
repositories {
flatDir {
dirs 'libs'
}
}
.
.
.
}
3. Add the following dependencies to the dependencies tag in the build. gradle file.
dependencies {
api fileTree(dir: 'libs', include: '*.jar')
implementation (name:' Yours aar Name ', ext:'aar')
}
Summarize