Android manifest attribute not allowed here

旧巷老猫 提交于 2019-12-03 22:25:50

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

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

In Android Studio just close the Manifest file and open it again. It will solve the issue. By the way Studio gives too many stupid errors like this.

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.

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.

Most Probably, you are modifying the wrong Manifest.xml. When you attempt to run your code, it creates temporary files which might be what you are editing.

This happens when manifest not correctly "recognized" by AndroidStudio: it is correct location file app/src/main/AndroidManifest.xml, but not in synthetic AS Android/app/manifests tree left-view.

Just close the project + remove from (welcome)list + re-import_project (Gradle, Eclipse ADT, etc).

Just open your AndroidManifest.xml file in another editor like notepad++ and apply some changes ,then save it. that might work as a trick!

Simple thing is copy paste backup manifest.xml on the project or save code on notepad and saveas with same manifest.xml and override on old manifest.xml

Close the andorid studio and open the AndroidManifest.xml from the application folder in any of the local editor for e.g., Notepad,notepad++,sublime etc. Make change and save the manifest file. Now open the androdistudio. Your problem will be solve.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!