At last I solved the error myself. It was an Android API issue. Installed the minimum required API and it worked.