Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Marks syntax as error, but gradle compiles

I have a project in Android Studio which compiles with Gradle. The general file structure is

MyProject
  - MyProjectSource
  - Libraries
     - ActionBarSherlock

My project is built with Gradle and will compile without issue. However in the lines within my activity where I include a component from ActionBarSherlock, Android Studio marks it as an error.

I have noticed that Android Studio has also generated .iml files. So my question: Does Android Studio ignore the gradle build when assessing whether something is valid syntax or not?

Obviously this is not a project blocking problem but it does slow velocity not being able to take advantage of the full set of tools Android Studio has to offer.

Thanks in advance for any help.

like image 858
laochiv Avatar asked Sep 28 '13 04:09

laochiv


1 Answers

Go through the link and it worked for me.

1.) Choose File option from menu on left top side of android studio. 2.) Select the option : "Invalidate Cache/ Restart.." It will open an dialog. 3.) Click on the first button with option : "Invalidate and Restart" 4.) It will close the studio and restart it. Start indexing of the project. It resolved my problem

Go to File -> Invalidate Cache/ Restart -> Invalidate and Restart

Source https://www.youtube.com/watch?v=FX_gCTpqhwM

like image 144
Manmohan Soni Avatar answered Nov 07 '22 08:11

Manmohan Soni