Android的工作室不承认摇篮工程 [英] Android Studio not recognising Gradle projects

查看:1116
本文介绍了Android的工作室不承认摇篮工程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论我怎样导入项目,他们从来没有工作 - Android的工作室始终萎靡不振这不是一个摇篮建设项目

No matter what projects I import they never work - Android Studio is always flagging this is not a Gradle build project.

我选择 VCS - > GIT 和克隆回购没有任何问题。然后,我通过没有问题精灵(我选择从现有资源项目),以警告创造我code基,下文。当我尝试运行抛出各种各样的错误。

I select VCS -> GIT and clone the repo without any problem. I then go through the wizard with no issues (I select create project from existing sources), creating my code base with a warning, below. When i try to run throws all sorts of errors.

移植项目到摇篮?本项目不使用编译摇篮
  系统。我们建议您迁移到使用构建摇篮
  系统。有关迁移到摇篮的更多信息。

Migrate Project to Gradle? This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system. More Information about migrating to Gradle.

不要再显示此消息。

当我去是没有意义什么对我来说,它说,以创建任意文件摇篮和我引用(我认为),这超出了我的理解填充它的链接。我不应该有这样做,因为它在存储库指令,它实际上是一个基于摇篮项目说。

When I go to the link it makes no sense whatever to me, it says to create an arbitrary Gradle file and populate it with my references (I think), which is out of my understanding. I shouldnt have to do this as it says in the repository instructions that it is in fact a Gradle-based project.

我试图复制该项目
https://github.com/googlesamples/android-play-location.git

有人能告诉我具体怎么在Android Studio中导入并运行下面的混帐回购协议例如?

Can anybody tell me specifically how to import and run the following git repo in Android studio for example?

推荐答案

从一开始就确定(因为我不知道还有什么其他的方式工作)

Ok from the start (as i dont know what other way works)


  • 转到Git的母版页(它有下载到压缩或克隆桌面按钮)。使用 https://github.com/googlesamples/android-play-location 作为测试母版页,如果你想确保你没有其他问题,我没有。

  • 单击下载zip

  • 解压项目

  • 在Android Studio中关闭当前项目 - >文件/关闭项目

  • 像这样的弹出式屏幕上会出现,选择导入项目(Eclipse的ADT,摇篮等)

  • 您会被要求选择项目,主文件夹中选择解压缩的项目,如basicLocation

  • 选择从现有的资源项目的默认

  • 不改变项目名称(可能会导致问题)

  • 下一步通过进口项目 - >目录

  • 下一步通过项目 - >库

  • 然后通过进口项目 - >模块和模块依赖

  • 然后通过进口项目 - > SDK

  • 然后通过进口项目 - > manifest.xmls

  • Android的工作室开始。确保配置下拉菜单中有一个项目叫做应用应用

  • 选择同步摇篮图标(绿圈)

  • 可以上语言警告,忽略或接受重启,并不重要

  • Go to Git master page (it has 'download to zip' or 'clone to desktop' button). use https://github.com/googlesamples/android-play-location as a test master page if you like to ensure you have no other issues i did not.
  • Click 'download zip'
  • Unzip the project
  • Close the current project in Android Studio -> File/Close Projects
  • A popup screen like this will appear, choose Import Project (Eclipse ADT, Gradle etc.)
  • You will be asked to select the project, select your unzipped project within the master folder, eg basicLocation
  • Select 'create project from existing resources' default
  • dont change project name (may cause issues)
  • Next through 'import project -> directories'
  • Next through project -> libraries
  • Next Through import projects -> modules and module dependencies
  • Next through import project ->SDK
  • Next through import project ->manifest.xmls
  • Android Studio starts. Ensure the configurations dropdown has a project in it called 'app' app
  • Select 'sync Gradle' icon (green circle)
  • May get language warning, ignore or accept restart, doesnt matter

在底部,应该说现在'摇篮执行任务后,它会在设备或模拟器运行:)

At bottom it should now say 'Gradle executing tasks' after which it will run on device or emulator :)

这篇关于Android的工作室不承认摇篮工程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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