Android Studio打包生成SDK(打包jar包和aar包)

1,373 阅读1分钟

废话不多说,直接上干货:

1.所需工具:Android Studio(建议使用release版本,预览版不保证能够成功)

image

2.打开module的gradle

image

3.修改这个文件的内容如下

apply plugin: 'com.android.application'

改成

apply plugin: 'com.android.library'

(切换成library模式)

4.注释applicationId

//        applicationId "com.example.pingban"

下面是整图

image

5.然后点击sync Now,等待成功之后,再点击Rebuild Project

image

6.成功之后,你就可以得到jar包和aar包,需要哪个拿那个

jar包的目录:app/build/intermediates/packaged-classes/debug aar包的目录:app/build/outputs/aar 怎么用应该就不用赘述了吧,搞定!

原文转载 www.jianshu.com/p/a9eab50aa…