Android Studio cannot resolve R in imported project?

joe_deniable picture joe_deniable · May 16, 2013 · Viewed 104.6k times · Source

I'm trying the new Android Studio. I've exported a project from eclipse, using the build gradle option. I've then imported it in Android Studio. The R.java file under gen has a j in a little red circle on it. And in my source files, I get "cannot resolve symbol R" wherever I have a reference to a resource, e.g. "R.layout.account_list" etc.

I have never used Intellij before. Would appreciate any help as there obviously aren't many answer yet about Android Studio. Thanks!

Answer

Crossle Song picture Crossle Song · May 16, 2013
  1. Press F4 into Project Structure, Check SDKs on left
  2. Click Modules ---> Source Tab, check gen and src as sources

PS: The answer over a year old and the menus have changed.