Accepted answer

check the "android version to use when rendering layouts" and make sure you're not using a version that ends in "w" for android wear (e.g. api 20: android 4.4w). i don't believe wear supports edittext.

in both android studio and eclipse, it's the dropdown with the green android in the layout preview's toolbar. you may want to set it explicitly and not allow the ide to choose the android version automatically.


i deleted 4.4w from my sdk install pile, which must have slipped past me last time i installed an sdk. once i removed it it was no longer and option, and eclipse picked an sdk i did have that wasn't w and it worked.


the w in android 4.4w suggest wearable devices. android wear is a wrist watch and you cannot type anything in it so you cannot use edittext on 4.4w. change the api to 19 or less or change it to 4.4l

check it out @

you can change your previewing api version as jim suggested if u don't want to develop apps for wearable devices.


if you are facing this on android studio, follow along

1) uninstall android 4.4w(api 20) from the sdk manager

2) make sure you have android sdk build tools 19.1 installed from the sdk manager.

3) edit build.gradle within your app folder. set the following two values as below

compilesdkversion 19
buildtoolsversion "19.1"

4) the ide will prompt you to sync the gradle file with your project, click yes.

5) open your activity file and then change the 'android version to use when rendering layouts in ide' to 'api 19'. this is the green colored android bot towards the right on the preview window


i changed my android version for android 4.2, but it still not work for me. i tried different solutions found that it only work by deleting android 4.4w package.

window > android sdk manager > check android 4.4w(api 20) if it was installed > delete package


from the eclipse ide, just change the api version to use for previewing, as shown in below screenshot. instead of "automatically pick best", manually select the one which works for you (api 17 worked for me).

enter image description here

Related Query

More Query from same tag