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

Android Studio

Android Studio Problem Overview


I get Namespace 'app' not bound whenever I try to specify the properties for the external libs UI elements.

        <LinearLayout
            android:id="@+id/card_database"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clickable="true"
            android:onClick="dbclicked"
            android:orientation="horizontal"
            android:background="#ffff7f31"
            >

            <ImageView
                android:id="@+id/img_database"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/db"
                />

            <TextView
                android:id="@+id/txt_database"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center_vertical"
                android:paddingStart="15dp"
                android:text="@string/db"
                android:textColor="#ffffff"
                android:textSize="20sp"
                android:autoText="false" />
        </LinearLayout>
        </com.balysv.materialripple.MaterialRippleLayout>

compile 'com.balysv:material-ripple:1.0.0' is used in build.gradle and I am running the latest version of the Android Studio with updates.

Android Studio Solutions


Solution 1 - Android Studio

Add

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

to your root element

Solution 2 - Android Studio

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

Solution 3 - Android Studio

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>

Solution 4 - Android Studio

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionUtkarsh Narain SrivastavaView Question on Stackoverflow
Solution 1 - Android StudioAnders MetnikView Answer on Stackoverflow
Solution 2 - Android Studioabdullah_bdView Answer on Stackoverflow
Solution 3 - Android StudioAnkit HotaView Answer on Stackoverflow
Solution 4 - Android StudioRay JamesView Answer on Stackoverflow