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!
"R cannot be resolved" arise only if there is a problem with some of your resource files. So the best and effective way is delete the last done xml or drawable in res file. and then again start from there according to android coding norms.
R is a class containing the definitions for all resources of a particular application package. It is in the namespace of the application package. For example, if you say in your manifest your package name is com. foo. bar , an R class is generated with the symbols of all your resources in com.
R. java is the generated file by ADT or Android studio. It will be located under app\build\generated\source\r directory.
PS: The answer over a year old and the menus have changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With