Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"
like image 671
Ravi Avatar asked Feb 12 '16 06:02

Ravi


2 Answers

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.

like image 58
Ravi Avatar answered Nov 15 '22 15:11

Ravi


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

like image 40
Gaket Avatar answered Nov 15 '22 14:11

Gaket