Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: import project from Gradle

I want to import my android project (created with Android Studio there are 4 months ago) to my new laptop with Android Studio. So when I select the folder where my project is, a pop-up appears "Import project from Gradle" with different options; by default "Use local gradle distribution" is selected.

But I don't know how to get the Gradle home path on my laptop.

Env:

  • MacOSx
  • Android Studio v0.8.6 (beta)
like image 262
anthony Avatar asked Aug 27 '14 21:08

anthony


People also ask

How do I import a project into Android Studio?

Go to File->New->Import Module then browse you project. After importing module go to project structure and add module dependency to your project.

How do I sync Gradle with Android Studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.


2 Answers

Import project instead of Open project

Screenshot

like image 86
apricot Avatar answered Oct 04 '22 05:10

apricot


Do you have gradle installed? If not, following this guide will help.

Ideally you don't want to select the "Import project from Gradle" option though - you should be using the gradle wrapper created with the project. If there is no gradle wrapper, create a new project and copy the gradle wrapper across.

The gradle wrapper will download the correct gradle version for the project, and avoids the need to have gradle installed locally.

like image 27
athor Avatar answered Oct 04 '22 06:10

athor