Programming/Non programming

Tuesday, September 6, 2011

Android: Invalid file name: must contain only [a-z0-9_.]

Android:

When we create the new layout in Android project, we might encountered with the following error and looking for solution.

Error:


MyApp] res/layout/MyFileName.xml: Invalid file name: must contain only [a-z0-9_.]



Solution:


In the Android development, we might have created the layout with ".xml" extension. I created a layout as "MyFileName.xml". I got the same error.

The problem is, do not create layout with uppercase letters. The solution would be in my case is "myfilename.xml". So, create the layout with all lowercase letters.


Good luck!

M.P.Prabakar.
Tech lead.
Mobile app development.