All the code was working perfectly and nothing was wrong. Suddenly when i want to run the app it gives me this one error.
I have not touched the code.I tried uninstalling
Try disabling the "Only sync active variant" option and rebuilding. It worked for me.
EDIT:This address is for Android Studio with newer versions Setting > Experimental > Only sync the active variant
Setting > Experimental > Only sync the active variant