0

I have imported a project from GitHub into Android Studio, however there is not a gradlew nor gradle.bat file.

I read about how I could generate them from questions like this one, so I ran the following command in the terminal:

gradle wrapper

However, I was given an error:

'gradle' is not recognized as an internal or external command,
operable program or batch file.

Also, in Android Studio, I have set the following setting:

Build, Execution, Deployment > Build Tools > Gradle [For current project]

...

  • Project-level settings

    [x] Use default gradle wrapper (recommended)
    [ ] Use local gradle distribution...

...

So my question is, how can I resolve the error and generate the gradlew and gradle.bat files?

Community
  • 1
  • 1
Farbod Salamat-Zadeh
  • 19,687
  • 20
  • 75
  • 125
  • I think it might be Eclipse Android project so try this: http://tools.android.com/tech-docs/new-build-system/migrating-from-eclipse-projects – piotrek1543 Dec 27 '15 at 13:09
  • 1
    [This](http://stackoverflow.com/a/25770202/542270) answer to the question mentioned that you need to *have gradle installed* to run generate the wrapper files. – Opal Dec 27 '15 at 13:58
  • @Opal Thanks for the tip. It seemed as though in my case, I had deleted gradle wrapper files (I was trying to edit my GitHub project by importing it to Android Studio, and I had deleted the original files that I uploaded. I accidentally put in .gitignore to not upload those files to GitHub so they weren't there when I imported the project). I found them in my recycle bin and restored them. However, if I didn't have the files, your comment could have solved my issue too. – Farbod Salamat-Zadeh Dec 27 '15 at 14:07
  • @FarbodSalamat-Zadeh, great. If you found the linked answer useful upvote it along with the question. – Opal Dec 27 '15 at 14:25

1 Answers1

0

It seemed as though in my case, I had deleted gradle wrapper files (I was trying to edit my GitHub project by importing it to Android Studio, and I had deleted the original files that I uploaded. I accidentally put in .gitignore to not upload those files to GitHub so they weren't there when I imported the project). I found them in my recycle bin and restored them.

Farbod Salamat-Zadeh
  • 19,687
  • 20
  • 75
  • 125