Difference between build.gradle(Project) and build.gradle(Module)

后端 未结 3 1086
醉话见心
醉话见心 2020-11-28 22:41

I am trying to add a dependency of Android Asynchronous Http Client into my project. So there are two build.gradle files are there in the project.

3条回答
  •  死守一世寂寞
    2020-11-28 23:06

    About relation of the two gradle files, hrskrs made a very clear explanation,I will make some supplement about it.

    if your project only has one Module (such as app),the advantage of top build.gradle(Project:My-app) not show very clear. because you can config everything in build.gradle(Module:app) about the Module,and only modify one file when upgrade in following days。

    but if your project has 5 Modules,and it happened that they have a same dependence A, if you dont use the top build.gradle(Project:My-app) you need maintain 5 files in following days.

    by the way ,the build.gradle(Module:app) can overwrite the build.gradle(Project:My-app).

    This design can improve the maintainability of APP

提交回复
热议问题