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

前端 未结 3 584
礼貌的吻别
礼貌的吻别 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)

    0 讨论(0)
  • 2021-01-22 01:43

    I just do not understand what you want to do. But try changing the following line:

    project(':LibraryA').projectDir = new File('../ProjectA')
    
    0 讨论(0)
  • 2021-01-22 02:01

    One of your projects does not have a valid gradle file. If your library is not a gradle project convert it to gradle project.

    If you add your library as a module and select "gradle" when you are importing i think you'll solve your problem.

    0 讨论(0)
提交回复
热议问题