Android studio:这个项目不是基于 gradle 的项目 [英] Android studio: this project is not gradle based project

查看:67
本文介绍了Android studio:这个项目不是基于 gradle 的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个最初在 Eclipse 中的项目,然后我设法以某种方式将其转换为 gradle,并且在 Android Studio 中一切正常.

I have one project which was initially in eclipse, then i managed somehow to convert it to gradle and everything was working fine in Android Studio.

但后来我有一段时间没有参与该项目,几个月后当我回到项目时,我很惊讶 Android Studio 有这个项目的问题.

But then i didn't work some time with the project and after few months when i returned to project i am surprised that Android Studio has problems with this project.

当我从 AS 的左上角下拉菜单中选择Android"时,您应该在其中看到项目为 Android,但我没有看到任何文件,然后我做了一些事情,现在我看到了一个空文件夹 Java.

When i selected "Android" from top left dropdown in AS, where you should see the project as Android, i saw no files, then i did something and now i see there one empty folder Java.

如果我点击将项目与 gradle 文件同步"按钮,AS 会显示以问题名称发布的消息,但它是基于 gradle 的项目.. 有 gradle 文件等.

If i hit button "sync project with gradle files" AS says message as posted in name of question, but it is gradle based project.. there are gradle files etc.

有人知道为什么会出现这个问题吗?为什么它应该像这样停止工作?

Do you someone know why is this problem? Why it should stop work like this?

谢谢

推荐答案

确保从其根目录打开项目.即包含顶级 build.gradle 文件的目录.

Make sure you open the project from its root directory. i.e. the directory which contains the top level build.gradle file.

缺少顶级 gradle 文件是导致此错误的原因.

The missing top level gradle file is what causes this error.

这篇关于Android studio:这个项目不是基于 gradle 的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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