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 whene
Had same issue - the issue was the Manifest file was did not have the default Activity setup properly.
If you run into this with a package that has been building before you need to "Rebuild". Build->Rebuild Project . Deleting gen does not do it since IDEA saves the actual generated R somewhere else.
To all the hopeless people who have reached this far down the answers: I feel your pain. I have spent an hour doing nothing but trying all those things above as well as proposals from other sources. I have checked all my xml resources twice, cleaned caches, rebuilt a dozen times, even restarted the entire machine. Here is what actually worked for me:
Under 'Build Variants' (lower left corner), I selected a different Build Variant (in my case release instead of debug) for the target that had the missing R problem. Solved it.
Try create new project and select "Create project from existing sources"
I just restart IntelliJ and it magically solved. Try it first.
In my case, I added some classes from another project and I had to add the import to the R package from my actual project:
import com.youcompanyname.yourprojectname.R;