
目录
1.首先什么是aar格式
2. 怎么把一个模块编译成一个aar
首先把鼠标放到要编译的模块上
然后再点击:Build ->Build Module 'xxx' 刚刚鼠标选的模块
最后生成的aar包在这里
3. 怎么引用aar包
例如我把我刚刚编译的aar包放到 我要引用的app/build/libs/xx.aar
修改这个APP 的build.grade
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)These entrIEs are directly at the root of the zip file. 也就是说是相当于AndroID工程里的一个module 打包成一个aar的压缩包模式 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;
总结
以上是内存溢出为你收集整理的Android studio 怎么打包成aar包和引用aar包全部内容,希望文章能够帮你解决Android studio 怎么打包成aar包和引用aar包所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)