删除后如何重新生成build.gradle文件 [英] How to regenerate build.gradle file after deleting
问题描述
我的Android项目出错: Gradle项目同步失败错误
,然后我搜索了解决方案此处。但是,我删除了错误的文件(用户主目录中的build.gradle而不是.gradle)。那么如何再次在Android Studio中生成build.gradle文件?
I got an error with my Android project: Gradle project sync failed error
, and then I searched the solution here. However, I deleted wrong file(build.gradle instead of .gradle in the user home directory). So how do I generate build.gradle file in Android Studio again?
推荐答案
打开IDE并仅创建一个名为<$的文件c $ c> build.gradle 如果删除了顶层文件,则位于根文件夹中;如果删除了顶层文件,则位于模块内部。
Open your IDE and just create a file called build.gradle
in the root folder if you deleted the top-level file, or inside a module if you deleted it.
这是一个文本文件,您必须在其中编写脚本。
It is a text file where you have to write your script.
您可以复制标准配置,只需从新项目中复制即可。当然,您必须使用依赖项和配置来自定义文件。
You can copy the standard configuration, just copying from a new project. Of course you have to customize your file with your dependencies and your configuration.
这篇关于删除后如何重新生成build.gradle文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!