编程知识 cdmana.com

Android studio package using AAR

1. establish library module:jacklib

Android Studio Will be automatically settings.gradle Add the following , Other project references need to add the following manually

include ':jacklib'

2. Use... Directly in the project library

stay app/build.gradle Add the following below the file

implementation project(':jacklib')

3. stay Android Studio in Rebuild Project Will generate aar-debug.aar file , In your library Below “build/outputs/aar/” Under the folder , be known as jacklib-debug.aar

4. Generate jacklib-release.aar

stay Android Studio Of Terminal Window input the following command

> gradlew assembleRelease

In your library Below “build/outputs/aar/” Under the folder , be known as jacklib-release.aar

5. Use aar package

Use aar Methods : copy to libs Folder , stay app/build.gradle Add... Below

repositories {
    flatDir {
        dirs 'libs'
    }
} 
dependencies {
    implementation(name:"jacklib-release", ext:"aar")
}

perhaps

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
    ...
    implementation files("libs/jacklib-release.aar")
}

 

版权声明
本文为[Dora d dream]所创,转载请带上原文链接,感谢

Scroll to Top