Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Tools Using Git for Android Creating a New GitHub Project

Charles Harpke
Charles Harpke
33,986 Points

gradle issue when importing from GIT

gradle issue when importing from GIT:

  1. Android Studio was not running. 2 ran: git clone https://github.com/charpke/WorkshopApp.git from the terminal.

  2. From the Finder, I went to: /Users/charlesharpke/AndroidStudioProjects/WorkshopApp -copied all the files -pasted them all in: \WorkshopApp Started Android Studio From Android menu: File Open Navigated to /Users/charlesharpke/WorkshopApp Under Gradle Home: 'Gradle location is unknown' Manually added it from the sidbar The path I tried manually adding was: /Users/charlesharpke/WorkshopApp/gradle--this did not work tried: /Users/charlesharpke/WorkshopApp/gradle/wrapper----this did not work

7 Answers

Hi Charles,

I see what you are talking about. Seems like when you were building the project, the gradle was not defined correctly or some other reason revolving around gradle.

However, while importing the project into Android Studio, I chose to build a local repository radio button of the gradle. It downloaded the missing files from the gradle repository and everything worked fine.

Hope this helps. Ask again if you need help

Ivan Koch
Ivan Koch
22,817 Points

Hi Rustam, I was having the same problem. Try importing the project rather than opening it. It worked for me, I dont know why !

Charles Harpke
Charles Harpke
33,986 Points

Building the local repository works. Thank you.

Rustam Eynaliyev
Rustam Eynaliyev
1,993 Points

I have the same problem. But I didn't quite understand your solution.

Francois Martel
Francois Martel
24,694 Points

I followed along with Ben in the video and moved my files into a new folder, which created a path nightmare. I couldn't run the app because of Gradle errors, even though I thought I had all the files in the right folder. Maybe I should have changed the path in one of the Gradle files? Well anyways I did what Ivan suggested above and it works now. So thanks Ivan!

I was having the same problem. Selecting Import Non-Android Studio project from the Android Studio Welcome Screen worked for me.

Luke Liem
Luke Liem
6,367 Points

I had the same problem. Following Ben's instruction of moving the content of an old project to a new folder for Git Version Control, I discovered that even though I change the code, the gradle was building from the source code of the old folder.

The solution is to "import" the project rather than opening it from Android Studio. This was the solution offered by Ivan Koch.