Found the problem.
I had defined these attributes in the attrs.xml in the following format
<declare-styleable name="HorizontalPager">
<attr name="ignore_vertical_scroll" format="boolean" />
<attr name="page_width_proportion" format="integer" />
</declare-styleable>
<declare-styleable name="HorizontalPager">
<attr name="off_screen_page_limit" format="integer" />
</declare-styleable>
Both the styles had the same name and now during compilation the second attribute definition was overriding the first attribute definition because of which aapt was not able to find the said attributes. Combining these two definitions into a single one fixed the problem.