android studio
一个window只能加载一个project,一个project包含多个module,如何在当前的project的module里使用另一个project的module呢?
1.在settings.gradle
里用,通过include ":另一个project的名字"
include ":anotherProjectName"
2.然后指定include
的project
的projectDir
,就是要导入的另一个工程的目录
project(":anotherProjectName").projectDir = new File("F:/anotherProjectName")
3.现在在一个window里就有两个project了,如何使用新导入的project的module呢?
include ":anotherProjectName:module1",":anotherProjectName:module2"

注意
如果你引入的module
是一个library
,并且这个library
包含有原生代码c/c++,请记得在本project里先配置好Android NDK location
,否则会出现以下错误
Sync with Gradle for project 'FaceDetect_Chengdu' failed: A problem occurred configuring project ':TGVision:libyuv'.

网友评论