Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate project to gradle error

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.

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.

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.

like image 545
vishalmullur Avatar asked Sep 29 '14 07:09

vishalmullur


3 Answers

Most probably you have git checkout a parent directory of a working android project.

  1. Close freshly checked git project
  2. Open Project
  3. Navigate to the git checkout directory
  4. Select a sub directory inside the git checkout project and that is the intended android project for you
like image 152
HimalayanCoder Avatar answered Oct 07 '22 08:10

HimalayanCoder


If you haven't started coding in your new machine, the simplest way would be to just delete your project directory, and use "import from VCS".

Not worth the time to find the "solution", trust me. I tried. Almost 2 years since you asked the question, and people are still getting the issue, then this problem is obviously not worth solving.

like image 26
magicmushroom Avatar answered Oct 07 '22 08:10

magicmushroom


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

  • bin/
  • build/
  • .idea/
  • .gradle/
  • projectname.iml

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.


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?

like image 16
AZOM Avatar answered Oct 07 '22 10:10

AZOM