Solved : AAPT: error: unbound prefix / file failed to compile

When we tried to edit the existing layout XML in android by adding Material theme for EditText, but got the below error,

   > Android resource compilation failed
     /home/myuser/android_app/app/src/main/res/layout/fragment_name.xml:43: AAPT: error: unbound prefix.
     /home/myuser/android_app/app/src/main/res/layout/fragment_name.xml: AAPT: error: file failed to compile.

Solution :

In our resource xml file, following line was missing,


So, we changed /home/myuser/android_app/app/src/main/res/layout/fragment_name.xml to make it like,

<RelativeLayout xmlns:android=""


So, in your code it can be any Layout.

Leave a Comment