app declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project

后端 未结 11 1911

I am importing a library module named \"wear\" in my project and while building, I am getting this:

Error : A problem occurred configuring project \':app\'.   
C         


        
11条回答
  •  醉酒成梦
    2021-02-03 17:48

    Actually the project itself lays inside the target project root folder:

    ...
     |-wear
          |-app
    

    So in order to include it properly you have to define path that points to that inner folder:

    'setting.gradle':

    include ':app', 'MyLibraryProject'
    project(':MyLibraryProject').projectDir = new File("X:\\SOME_PATH\\wear\\app")
    

    'app\build.gradle' (Main project)

    dependencies {
    ...
    compile project(':MyLibraryProject')
    ...
    }
    

提交回复
热议问题