1、创建一个Android Project
2、创建一个Model
注意:新建lib库时选择Minimum SDK版本越小越好,兼容性更高
3、创建好的项目结构
4、代码部分
- 在项目的build.gradle中加入
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
具体版本见下图
-
在Model的build.gradle中加入
apply plugin: 'com.github.dcendents.android-maven' group = 'com.github.你的github名称'
-
5、运行
./gradlew install