被告知项目没有使用 gradle 构建系统 [英] Being told project is not using the gradle build system when it is

查看:35
本文介绍了被告知项目没有使用 gradle 构建系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 Android Studio 中打开我的项目时,我总是得到这个.

When I open my project in Android Studio, I always get this.

当 Android Studio 刚出来的时候,我经历了这个过程,所以该项目应该有 Gradle 构建系统.项目根目录中有一个 build.gradle 文件.我仍然可以构建和运行该项目,但我不明白为什么它总是这样说,因为该项目应该使用 gradle 构建系统.对此有任何帮助都会很棒.

Back when Android Studio first came out, I went through this process so the project should have the Gradle build system. There is a build.gradle file in the root of the project. I can still build and run the project, but I don't understand why it always says this since the project should use gradle build system. Any help with this would be great.

推荐答案

android studio 支持两种构建模式".一种是遗留",一种是基于 gradle".如果您使用的是 android studio 的早期版本,那么您可能仍在使用旧版构建模式.您需要使用gradle 模式"重新导入您的项目,然后此警告将消失.

The android studio support two "build mode". one is "legacy" and one is "gradle based". If you are using an very early version of android studio, probably you are still using the legacy build mode. You need to re-import your project using "gradle mode" then this warning will be gone.

为此,选择文件/导入项目",选择您的项目根目录,然后在下一个对话框中选择从外部模型导入项目"并选择 gradle.然后,您可以选择gradle wrapper"或使用您自己的 gradle 发行版(目前为 1.8[12/2013]).

To do so, select "file/import project", select your project root directory, and in the next dialog choose "Import project from external model" and select gradle. Then, you may choose "gradle wrapper" or use your own gradle distribution (1.8 for now[12/2013]).

这篇关于被告知项目没有使用 gradle 构建系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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