I was trying to work out with multiple layout using some online tutorials. The thing is my program was building and compiling correctly as long as there was only one XML fil
My error got removed by importing the line
import com.example.myapplication.R;
your import line may be different depending upon your project name in which my project name is myapplication
Ivwd simply removed line "import android.R;" and call Project->Clean... That was enough for my on Win-7/x64 and Eclipse Kepler and last (02.2014) Android SDK
goto tools->android->Sync project with gradle file then click on S
I used maven as build tool, after I build my project and dig a lot in the internet to solution. My problem resolved by adding to the main_activity.xml
tools:context=".MainActivity"
Happened once. Don't know the reason.
Build> Clean Project removed the error for me.