Atukamix
Atukamix

Reputation: 71

Android Studio Gradle error

Everything is ok but when i try to run it gets one error

Gradle: : java.lang.NullPointerException

Please help me, because i wanna to throw all this stuff with my NTB down from the cliff, after about five hours of configuring git, android studio and copying my projects from Eclipse, still got this

Upvotes: 2

Views: 5484

Answers (5)

Angry 84
Angry 84

Reputation: 2995

I wont re-write my whole answer, but check out the following page in which i replied to a Gradle common error with over 10 common solutions across the web including mine.

Long story short, for me it turned out to be system resources were getting low (Google Chrome was the greedy one)

If it works after a fresh reboot, but after a few minutes or hours it starts.. This would indicate this.

Gradle Error In Android Studio

Upvotes: 0

Sergio B.
Sergio B.

Reputation: 998

As easycheese underlined the problem is related to the presence of the android-gradle item below one or more modules in your project. Go to the "project structure" (from the File menu) and check which module has two sub-items, one of them must be the android-gradle, delete it and rebuild your project. It should fix the issue......as J.Romero says...Android Studio is far from being ready for professional use, but what it is really annoying is that Google, with all its resources, gives developers such "immature tools" that make rather waste time than anything else....shame

Upvotes: 0

easycheese
easycheese

Reputation: 5899

I had the same problem. I solved it by going into 'Project Structure' and one of my modules had both 'Android' and 'Android - Gradle'. I deleted the 'Android - Gradle' and rebuilt the project and the error disappeared.

Edit: I had bigger problems than this and ended up creating a new project...

Upvotes: 4

JRomero
JRomero

Reputation: 4868

You need to make sure Gradle is installed and properly configured in the preferences.

Upvotes: 2

TheHawk
TheHawk

Reputation: 21

I had the same problem. It was because the path to android studio contained a whitespace. Installing android studio to the recomended location solved my problem.

Upvotes: 2

Related Questions