将项目迁移到gradle错误 [英] Migrate project to gradle error

查看:153
本文介绍了将项目迁移到gradle错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Android Studio创建了一个项目并将其推送到bitbucket.几周后,现在我已将其克隆到另一台计算机上以继续工作.我在Android Studio中导入了该项目,但现在仍然出现此错误.

I had created a project with Android Studio and pushed it to bitbucket. After few weeks now I have cloned it on different machine to resume my work. I imported the project in Android Studio and now I keep getting this error.

将项目迁移到Gradle? 该项目不使用Gradle构建系统.我们建议您迁移到使用Gradle构建系统. 有关迁移到Gradle的更多信息. 不要再显示此消息.

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. Don't show this message again.

我的项目中有gradle目录.我尝试使用使用本地gradle分发的选项,并将其指向下载的gradle-1.10,但仍然出现相同的错误.

I have the gradle directory in my project. I tried using the option of use local gradle distribution and pointed it to downloaded gradle-1.10 but I still keep getting the same error.

推荐答案

首先,我将从您的项目文件夹中删除以下文件/目录:

First of all I would remove following files/directories from your project-folder:

  • bin/
  • 构建/
  • .idea/
  • .gradle/
  • projectname.iml

然后尝试在AndroidStudio中再次导入该项目.这通常对我有用,并且为了避免将来再次出现这种情况,请正确调整 .gitignore 文件.

Then try to import the project again in AndroidStudio. This usually works for me, and to avoid that in the future, adjust the .gitignore file properly.

如果第一个技巧没有帮助:您是否尝试过在本地下载更新的gradle(1.12)并指向该目录? (不要指向AndroidStudio下载,而是先自己做). 您不使用gradle-wrapper吗?

If the first tip does not help: have you tried downloading a more recent gradle (1.12) locally and point to that directory? (Don't point AndroidStudio to download, but do it yourself first). You are not using a gradle-wrapper are you?

这篇关于将项目迁移到gradle错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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