Android manifest attribute not allowed here

In my case, closing the AndroidManifest.xml AND choosing File > Invalidate Caches / Restart solved the issue.

Not sure why I had to do the last step as well but it sorted out all those errors for me.


For your "attribute not allowed here" problem, versionCode, versionName and allowBackup have to be placed in the build.gradle file and not in the Android Manifest. That should solve the problem.

Secondly, for your "@style/AppTheme no resource matches the given name" problem, you will have to check your styles.xml file and make sure that a style with the name AppTheme exists over there.

Hope this helps you or anyone who views this answer.


Just Close your manifest file and reopen it. It worked for me.


Close AndroidManifest — File — Sync Project with Gradle Files. It helped.

P.S. A few months later I met this problem again — googled — found this answer and it didn't help! :D But this time I removed the Android Studio and installed the beta version. It helped.