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

查看:37
本文介绍了将项目迁移到 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/
  • 项目名称.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天全站免登陆