Namespace 'app' not bound, in Android Studio with external lib from Maven

Add

xmlns:app="http://schemas.android.com/apk/res-auto"

to your root element


So I have opened like 10 questions just like yours trying to solve this issue, but all the solutions never worked for me. Am going to post this to every other question similar to this one, just in case someone else get stuck in my position.

What worked for me: Open Tools> SDK manager then press edit SDK location. Now note the location, open it using windows explorer, copy the SDK folder to another location eg Desktop, Documents. Once done go back to edit SDK location then choose a new location where you pasted the SDK folder, press next then wait. It should be fixed.


Simply select the error (touch the error by mouse) and press. "ALT+ENTER" it will automatically solve the error.


Add xmlns:app="http://schemas.android.com/apk/res-auto" to root like this:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:orderInCategory="1"
        app:showAsAction = "ifRoom"
        />

</menu>