DX tool can not convert all java classes to dex format then this error occurs. In my case when i was getting error because there are some class which are using Java standard edition references and can not converted to dex. Generally it will convert all J2Me lib to dex format.As the suggestion from Bimbim.in, they said:
Second scenario is that when you are changing target platform or work space then there might be some inconsistency in build and it was fixed by just cleaning and rebuilding workspace.
"please clean your project and rebuild it when you are getting this exception."but, one more thing had to be done before:
Right click on the project, move the cursor to Android Tools and choose "Fix Project Properties"