I’m trying to use IntelliJ IDEA to work on an Android app with a colleague that swears by it, but I’m unable to build any of the Android projects he sends me because whenever I try a build I get an error saying package R does not exist.
I have been trying out everything I can think of. Examples and other things to note are:
-
Making sure I have a version of the
local.propertiesfile pointing to the root of my Android SDKs folder. -
Fiddling with various settings in the project structure dialog (I won’t list them all).
-
The project I’m working on has two library projects with also use the
Rclass and they work fine. -
The intellisense within the IDE recognises the
Rclass and comes up with the stuff I expect.
Any help would be greatly appreciated. I feel I’m missing something basic.
I am brand new to IntelliJ so I apologize if this doesn’t work for you. I was experiencing the same problem and the solution was to add an
AndroidFacetto your project.(I am on a Mac, so directions here may be slightly off, and there are probably better ways to find this window, if so let me know!)
Open Module Settings(seems F4 also works)Facetsin the far left columnAndroidFacetto your project, and VOILA!Rs now, which could be a huge pain… so hopefully someone can chime in with an easy way to auto-importHope this helps someone!