Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android studio "Use gradle wrapper" grayed out

I try to import an eclipse project into Android studio. In the migration instructions it says "In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)"

The problem is that the ""Use gradle wrapper" is unselected and grayed out.

Any suggestions?

like image 431
Asaf Pinhassi Avatar asked Jun 03 '13 06:06

Asaf Pinhassi


People also ask

Where is Gradle wrapper properties in Android Studio?

Open gradle-wrapper. properties(go to Gradle > wrapper > gradle-wrapper. properties and manually change the distributionUrl property in the file.

Where do you put Gradle wrapper?

The Wrapper shell script and batch file reside in the root directory of a single or multi-project Gradle build. You will need to reference the correct path to those files in case you want to execute the build from a subproject directory e.g. ../../gradlew tasks .


2 Answers

1) Create a new simple project with Android Studio.

2) Find the gradle folder in the new project.

3) Use the export option in eclipse to create the build.gradle script. (Requires at least adt version 22.0)

4) Copy the gradle folder into the project you want to export to Android Studio.

5) Now try to import this project, u shall be able to select the wrapper check box.

This may resolve the problem you asked for, you can also set the Gradle home path and use the other option just fine.

Hope this helps!

like image 157
JehandadK Avatar answered Sep 24 '22 23:09

JehandadK


I had this issue with a project that I had already previously built using Android Studio. It turned out that selecting the project appended a /gradle to the path of the directory when searching for a gradle wrapper. Removing the /gradle allowed me to select the option to use the default gradle wrapper.

like image 28
John Leehey Avatar answered Sep 25 '22 23:09

John Leehey