Monday, February 20, 2017

Beginning Android Development - Must Not Undeclare Prefix

Usually when we start with some development activities, especially for new developers, there are many common errors which we face. They are usually not big issues but they become roadblock for new developers and hence de-motivates them to start development. 

However, if we see the brighter side, they help us in learning system better and troubleshooting them helps us in understanding tool quickly.

One of the most common error users face while starting with Android Application Development with Android Studio is: 

Error:(2) Error parsing XML: must not undeclare prefix


If you see on other websites and blogs, it has been suggested to add below line or make sure you have below lines:

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

However, there are chances that above lines are already there and if you look at the exception or error message closely, you will see that it talks about some prefix which is not declared, so try to look for undeclared prefix and remove it. For eg. it could be like:



xmlns:app2="" 
Try removing it and any other similar undeclared prefix and then compile it. You should be able to move ahead and the program should compile.

Cheers !!

Please leave your comments if more solutions are found and if this has been helpful.

0 comments:

Post a Comment