Android-Studio:我的项目中没有build.gradle,为什么? [英] Android-Studio: No build.gradle in my project, why?
问题描述
我正在Android-Studio
上开发我的android应用程序.我的项目是checked out project from Git version control
.一切正常.除了我看不到build.gradle
文件.因此,我无法添加模块或库.
I am developing my android application on Android-Studio
. My project was checked out project from Git version control
. Everything works fine. Except that I cannot see build.gradle
file. Hence I am unable to add modules or libraries.
- 为什么我的项目没有
build.gradle
文件?! - 从Git导入我的项目时,我做错什么了吗?
- 我应该怎么做才能在没有
build.gradle
的情况下添加库?
- Why doesn't my project has a
build.gradle
file ?! - Did I do anything wrong to import my project from Git ?
- What should I do to be able to add libraries without having
build.gradle
?
这是我导入项目的工作:
Check out project from Version Control
-> Git
,
克隆后,将出现以下框:
after cloning, the following box appears:
我点击是".随即出现以下对话框:
I click `Yes. The follwoing box appears:
我接受默认选项,然后单击Ok
,然后出现以下框:
I accept the default options and click Ok
, then the following box appear:
同样,我接受默认选项,然后单击Ok
Again, I accept the default options and click Ok
然后将我的项目加载到Android-Studio
上.它向我显示以下消息:
Then my projec loads on Android-Studio
. It shows me the following message:
在我单击添加根之前,将出现以下框:
Before I click on add root, the following box appears:
我点击dont' remind me again for this project
.之后,我可以继续编程(Git和版本控制正在工作).但是build.gradle
无处可寻!!
I click on dont' remind me again for this project
. After that I can continue programming (Git and Version Control is working). But build.gradle
is nowhere to be found !!
更新1:
以下图像是project
视图:
我在做什么错了?
更新2:
这是Android
视图:
推荐答案
在 Stack Overflow 社区的大力帮助下,我找到了解决方法.这是我所做的:
With huge help from Stack Overflow community, I figure out how to solve it. Here is what I did:
- I totally removed
Android-Studio
following this guidance, then ... - I installed
Gradle
from this link, then ... - I re-installed
Android-Studio
following this link:
我猜到的主要问题是我没有手动安装Gradle,因此Android-Studio
使用某种Gradle-Wrapper来允许应用程序运行.
I am gussing the main problem was that I didn't installed Gradle manually and hence Android-Studio
was using some sort of Gradle-Wrapper to allow the application to run.
现在,终于可以编辑build.gradle
了.
Now, finally I can edit build.gradle
.
这篇关于Android-Studio:我的项目中没有build.gradle,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!