删除后如何重新生成build.gradle文件 [英] How to regenerate build.gradle file after deleting

查看:743
本文介绍了删除后如何重新生成build.gradle文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的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.gradlein 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆