This is so annoying isn't it !!
Most of us canrt recompile successfully
I am going to give the fix for this
Download this apktool in attachment
Now extract is to your windows pc C;//users/(your name)/apktool
Now download JDK from java.com and remove all java softs you used before!!!
Now take these from your ROMS system/framework framework-res.apk,semcgenericuxpres.apk and mediatek-res.apk(if you have ).
Copy jre(whole folder) from programme files java to C;//users/user/apktool
THen open control panel > java > go to java tab > now click view > then click find > now take it to the apktool folder and then click next and minimize it dont maximize.
Not open command promt from the apktool folder and type apktool if framework-res.apk , apktool if semcgenericuxpres.apk and all other frameworks you have
apktool if framework-res.apk
Now take any thing from that rom like settings.apk
To decompile type apktool d settings.apk
apktool d settings.apk
apktool b settings
You are done ! Any problem comment here !!!!