Configuration with name 'default' not found error on Android Studio

前端 未结 3 591
礼貌的吻别
礼貌的吻别 2021-01-22 01:09

I am trying to test to reference without copying a library Project. So I created two projects one is ProjectA and one is LibraryA. Both project

3条回答
  •  孤街浪徒
    2021-01-22 01:40

    In your settings.gradle (ProjectA) you are referring the wrong folder.

    include ':LibraryA'
    project(':LibraryA').projectDir = new File('../LibraryA')
    

    Checking your image, the LibraryA folder is a root folder.
    Gradle is searching for a "module" build.gradle while in this folder there is a top-level file configuration.

    You have to refer to the module inside the LibraryA

    project(':LibraryA').projectDir = new File('../LibraryA/app')
    

    Of course you have to pay attention if some tasks or variable are defined in the top-level file (LibraryA). In this case you have to clone them inside your top-level file (ProjectA)

提交回复
热议问题