将文件settings.gradle更改为以下内容(添加第三行)后,我尝试同步android项目

include ':app'
include ':libraries:volley'
project(':LibraryModule').projectDir = new File('/home/alexander/Projects/AndroidStudio/LibraryProject/LibraryModule')

为了在我当前的项目中使用LibraryModule中的代码。但是,同步失败并显示以下消息:
Error:Project with path ':LibraryModule' could not be found.

但是文件/home/alexander/Projects/AndroidStudio/LibraryProject/LibraryModule确实存在,并且包含以下两个文件:
LibraryModule/build/outputs/aar/LibraryModule-debug.aar
LibraryModule/build/outputs/aar/LibraryModule-release.aar

这次怎么了...?

最佳答案

试试这个:

include ':app'
include ':libraries:volley'
include ':LibraryModule'
project(':LibraryModule').projectDir = new  File('/home/alexander/Projects/AndroidStudio/LibraryProject/LibraryModule')

10-07 16:06