MowDownJoe
MowDownJoe

Reputation: 788

Android Studio not regenerating R.java; Gradle can't find assembleDebug task

I pulled some recent changes from my git repo, and suddenly, Android Studio was throwing up token not found errors for R.java. I hit "Make Project" in Android Studio, thinking a new build would fix these errors, when instead I got this:

Information:Compilation completed with 2 errors and 0 warnings in 5 sec
Information:2 errors
Information:0 warnings
Error:Gradle: 

FAILURE: Could not determine which tasks to execute.



* What went wrong:

Task 'assembleDebug' not found in root project 'project'.



* Try:

Run gradle tasks to get a list of available tasks.

Error:Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.

The fact that it won't compile explains the problems with R.java, but I'm mystified about the problems Gradle is having. Any help?

[Edit:] I booted into Linux and noticed that it didn't have the same issue. I also noticed under Project Properties that, in Windows there are no linked Gradle projects but in Linux, the project is listed as a linked project. Unfortunately, this tool to help me fix my issues apparently doesn't exist in Android Studio, only in IntelliJ proper.

Upvotes: 3

Views: 7619

Answers (3)

Lücks
Lücks

Reputation: 3994

Closing Android Studio and opening it again solved my problem.

Upvotes: 0

Vinuthan
Vinuthan

Reputation: 1045

Just close everything and Restart the Android Studio and compile once again. I faced the same problem many times. It worked for me !

Upvotes: 3

Green Apple
Green Apple

Reputation: 31

I had the same issue. I got it resolved my setting to the correct JDK folder path.

Also make sure you have "JAVA_HOME" environment variable.

Upvotes: 0

Related Questions