标签:
参考: http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio
举例:
库: https://github.com/AltBeacon/android-beacon-library.git
主工程: https://github.com/AltBeacon/android-beacon-library-reference.git
这个时候gradle文件sync是不成功的。因为默认会在主工程目录下寻找android-beacon-library目录,找不到。所以要在setting.gradle里加上
project(‘:android-beacon-library‘).projectDir = new File(‘../android-beacon-library‘)
setting.gradle里包含新的库
include ‘:app‘, ‘:android-beacon-library‘
android-beacon-library-reference的app模块下的build.gradle把引用aar改为引用工程
dependencies {
compile project(‘:android-beacon-library‘)
//compile ‘org.altbeacon:android-beacon-library:2+@aar‘
}
https://bitbucket.org/fangj/altbeacon-example
标签:
原文地址:http://www.cnblogs.com/awkflf11/p/5097505.html