在我的项目中,我有一个exoplayer的子模块。在我的settings.gradle
中,添加exoplayer的lib路径
def modulePrefix = ":exoplayer:"
def rootDir = new File('').toPath().toString()
include ':exoplayer:library'
include ':exoplayer:library'
include ':exoplayer:library-core'
include ':exoplayer:library-dash'
include ':exoplayer:library-hls'
include ':exoplayer:library-smoothstreaming'
include ':exoplayer:library-ui'
include ':exoplayer:extension-okhttp'
project(modulePrefix + 'library').projectDir = new File(rootDir,
'library/all')
project(modulePrefix + 'library-core').projectDir = new File(rootDir,
'library/core')
project(modulePrefix + 'library-dash').projectDir = new File(rootDir,
'library/dash')
project(modulePrefix + 'library-hls').projectDir = new File(rootDir,
'library/hls')
project(modulePrefix + 'library-smoothstreaming').projectDir = new
File(rootDir, 'library/smoothstreaming')
project(modulePrefix + 'library-ui').projectDir = new File(rootDir,
'library/ui')
project(modulePrefix + 'extension-okhttp').projectDir = new
File(rootDir, 'extensions/okhttp')
现在,我像这样在build.gradle
中添加exoplayer库的依赖项
implementation project(':exoplayer-library-core')
implementation project(':exoplayer-library-dash')
implementation project(':exoplayer-library-hls')
implementation project(':exoplayer-library-smoothstreaming')
implementation project(':exoplayer-library-ui')
implementation project(':exoplayer-extension-okhttp')
我得到这个错误
Project with path ':exoplayer-library-core' could not be found in root
project 'myProject'
答案 0 :(得分:0)
这就是我的做法:
settings.gradle:
rootProject.name = 'main'
include 'changelogs'
include 'common'
project(':changelogs').projectDir = new File(settingsDir, '../changelogs')
project(':common').projectDir = new File(settingsDir, '../common')
和Build.gradle
implementation project(':changelogs')