Error when using ScrollView in Android

August 18, 2010

If you have added a ScrollView to your layout in Android, you might get this error showing up in your IDE:

  • error: Error parsing XML: unbound prefix


The problem is likely that you have not provided the xmlns:android attribute. If you have placed your ScrollView around the default LinearLayout in the project, just move the xmlns:android attribute from the LinearLayout to the ScrollView that you added.

(The source for the error above came from Eclipse 3.6.0 when I hovered over the error icon to the left of the ScrollView tag in my main.XML file.)

Also thanks to Lars Vogel's tutorial for showing me where to place the ScrollView.
Anthony Tietjen

About the Author

Anthony Tietjen is a software engineer with experience across desktop, mobile, and web development. Husband and father, with a passion for music and the outdoors. Connect with Anthony on LinkedIn and X/Twitter