Ravi
Ravi

Reputation: 35549

null in android studio

Whenever i click on run project , it is showing me NullPointerException : null. I don't know what is the reason, why am i getting this?

enter image description here

NOTE Dont point this question as duplicate of What is a Null Pointer Exception, and how do I fix it?, because i am not getting null in any control or view or any line of code.

Edit : I am using Android Studio 1.4 with following gradle configuration :

compileSdkVersion 23
buildToolsVersion "23.0.2"

Upvotes: 11

Views: 4240

Answers (2)

Gaket
Gaket

Reputation: 6829

Strangely enough, I had the same issue, but Invalidation didn't helped. I even tried to reinstall Android Studio but it didn't help either.

Finally, I removed .idea folder and all other files from Android studio (*.iml) and re-imported project as a Gradle project and everything became fine.

I had Android Studio version 2.3

Upvotes: 1

Ravi
Ravi

Reputation: 35549

Strange I was finding for solution from more that 2 hours but solution was simple. I have tried with restarting system as well as Android Studio, but the thing which did trick for me is Invalidate and Restart.

you can find this option from File->Invalidate caches/Restart.

enter image description here

This did trick for me and now its not showing error.

Upvotes: 10

Related Questions