Android-Studio:我的项目中没有build.gradle,为什么? [英] Android-Studio: No build.gradle in my project, why?

查看:2335
本文介绍了Android-Studio:我的项目中没有build.gradle,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在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.

  1. 为什么我的项目没有build.gradle文件?!
  2. 从Git导入我的项目时,我做错什么了吗?
  3. 我应该怎么做才能在没有build.gradle的情况下添加库?
  1. Why doesn't my project has a build.gradle file ?!
  2. Did I do anything wrong to import my project from Git ?
  3. 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:

  1. 按照此指南,我完全删除了Android-Studio,然后...
  2. 我从此链接,然后...
  3. 我按照此链接重新安装了Android-Studio:
  1. I totally removed Android-Studio following this guidance, then ...
  2. I installed Gradle from this link, then ...
  3. 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屋!

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