This exception can also occur when you have a custom view in your layout like this:
<com.example.MyView
android:layout_width="match_parent"
android:layout_height="match_parent" />
and you change the view's package name from "com.example" to something different, but you forget to change it in the layout as well.