In Android Studio, right click on the project and choose Open Module Settings. Then go to theSources tab in your module, find the src folder, right click on it and mark it as Sources (blue color).
EDIT: There is no sources tab in later versions of Android Studio, but you can edit the build.gradlefile instead: http://stackoverflow.com/a/22028681/1101730 (thanks for comment Josh)
但是坑爹的我没找到相对应的 选项,那不行啊,还得继续啊!在上面的 回答下面还有个 回答如下:
I had the same problem while importing a project into Android Studio, probably caused by the fact that the project has been developed on an earlier version of Android Studio than currently installed on my computer.
What solved it was simply executing:
File -> Invalidate Caches / Restart...
and then clicking on Invalidate and Restart
.
上面的那个方法是 清理缓存,返回到上次正常状态!
File -> Invalidate Caches / Restart...
and then clicking on Invalidate and Restart
. 等待1到2分钟,ok了。