第一步: 将第三方模块复制到本工程与app模块同目录下
第二步:在settings.gradle 中加入引入模块的名字:
include ‘:app’, ‘:library’
第三步:同步工程,如果出现错误。就根据错误提示,在工程的gradle中添加配置
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
//add
classpath 'com.novoda:bintray-release:0.9'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
第三步:再次同步工程,正常情况下,会在Android视图下,出现了与app同层次的模块 library 。
第四步:在主模块app的gradle中添加配置:
dependencies {
......
implementation project(':library')
}
至此第三方模块就成功的加入到工程中并可以被主模块“app”来引用了。
本文介绍如何在Android项目中集成第三方模块,包括将模块复制到指定目录、在settings.gradle中添加引入、配置gradle依赖等步骤。
&spm=1001.2101.3001.5002&articleId=88813825&d=1&t=3&u=69d4126e36bc44689251f65463ebb373)
819

被折叠的 条评论
为什么被折叠?



