我的 android 项目的 build.gradle 文件在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21213025/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:09:13  来源:igfitidea点击:

Where is the build.gradle file located for my android project?

androideclipsegradleandroid-studio

提问by user3171799

Where is the build.gradlefile located for my android project? I'm trying to follow along with this tutorialbut can't make necessary changes to my build.gradlefile to use the support library.

build.gradle我的 android 项目的文件在哪里?我正在尝试按照本教程进行操作,但无法对我的build.gradle文件进行必要的更改以使用支持库。

回答by Binoy Babu

It will be located in the project root unless you have set a custom location. To generate a build.gradleuse eclipse and export project as build.gradle.

除非您设置了自定义位置,否则它将位于项目根目录中。生成一个build.gradle使用 eclipse 并将项目导出为build.gradle.

回答by Rohan

The app level build.gradle file is located inside your project folder under app/build.gradle. for eg: if your project name is MyApplication MyApplication/app/build.gradle. At this location, you will be adding dependencies for your project. There will be one more build.gradle file under your project folder immediately in new versions( As of April 2017). But to my opinion you never play with this file.

应用级 build.gradle 文件位于 app/build.gradle 下的项目文件夹中。例如:如果您的项目名称是 MyApplication MyApplication/app/build.gradle。在此位置,您将为项目添加依赖项。在新版本(截至 2017 年 4 月)中,您的项目文件夹下会立即多出一个 build.gradle 文件。但在我看来,你从来没有玩过这个文件。

回答by Amirouche Zeggagh

The location of build.gradle (Project)is in the root project

的位置的build.gradle(项目)是根项目

and the build.gradle (app)is in the /app/build.gradle of the projet

并且 build.gradle (app)在项目的 /app/build.gradle 中