Android Error Unexpected cast to Button: layout tag was FrameLayout
This is a Android Lint WrongViewCast Error message, what this error means is that you have casted a layout as a Button.
Suppose there is Button in your layout.xml file say button1 wrapped within a LinearLayout with id layout.
Now in your Java Class you have referred to the button by R.id.layout instead of R.id.button.
Button btn = (Button) findViewById(R.id.layout);
Button btn = (Button) findViewById(R.id.button);
If you think you need such functionality you can simple suppress this Error message to a warning or information.
1. Goto : Menu -> Window (Eclipse on Mac) -> Preferences -> Lint Error Checking
2. Now look for issue : WrongViewCast and change their severity from Fatal to Warning
3. Apply, now this error message will be displayed as warning.