Android 打aar包的方法

前言:此方法为不混淆方法

1.将 app项目目录下build.gradle 中的 applyplugin:'com.android.application' 替换为 apply plugin: 'com.android.library'

2.注释defaultConfig目录下的 applicationId "此处填工程包名"

3.修改 buildTypes 目录下的minifyEnabled false 如果为false则不变,如果为true则视为开启混淆需在proguard-rules.pro文件中填写混淆规则.: shrinkResources false不用可以注释

4.找到AndroidStudio开发工具屏幕最右侧gradle目录下app-->Tasks-->build-->assembleRelease

5.如无异常,在app-->build-->outputs-->aar目录中会生成aar包.(debug包和release包按需求在屏幕最左侧BuildVariants中修改)

你可能感兴趣的:(Android 打aar包的方法)