目录
然后再点击:Build ->Build Module 'xxx' 刚刚鼠标选的模块
例如我把我刚刚编译的aar包放到 我要引用的app/build/libs/xx.aar
1.首先什么是aar格式
看看官网的说明:
http://tools.android.com/tech-docs/new-build-system/aar-format/
The 'aar' bundle is the binary distribution of an Android Library Project.
The file extension is .aar, and the maven artifact type should be aar as well, but the file itself a simple zip file with the following entries:- /AndroidManifest.xml (mandatory)
- /classes.jar (mandatory)
- /res/ (mandatory)
- /R.txt (mandatory)
- /assets/ (optional)
- /libs/*.jar (optional)
- /jni/<abi>/*.so (optional)
- /proguard.txt (optional)
- /lint.jar (optional)
2. 怎么把一个模块编译成一个aar
首先把鼠标放到要编译的模块上
然后再点击:Build ->Build Module 'xxx' 刚刚鼠标选的模块
最后生成的aar包在这里
3. 怎么引用aar包
例如我把我刚刚编译的aar包放到 我要引用的app/build/libs/xx.aar
修改这个APP 的build.grade
新加如下:
然后再Mainactivity.java 里面引用aar中的class啦
import com.xx.TAInterface;