6

Brand new installation of IDEA 11 and Device Convigurations screen looks like this.

As I found from IDEA's docs, the default content is pulled from the XML file located at

Default configurations are stored in Sdk_Directory/tools/lib/devices.xml

I found this file and saw that it is full of content. However, Device configurations screen is still empty.

To repeat this is a brand new installation of IDEA 11 (the same with IDEA 12 preview) and brand new installation of Android SDK.

Why is this happening and how to fix this?

sandalone
  • 41,141
  • 63
  • 222
  • 338

3 Answers3

9

How I solved this issue!

This quote of IntelliJ team helped me

1. Custom configurations are stored in Home_Directory/.android/devices.xml
2. Default configurations are stored in Sdk_Directory/tools/lib/devices.xml
  1. installed brand new Android SDK
  2. pulled devices.xml file from Sdk_Directory/tools/lib/devices.xml
  3. copied it to Home_Directory/.android/devices.xml

Preview pane returned to previous state with all devices.

PS. this is a solution for Linux, but the same file exists in windows versions as well

sandalone
  • 41,141
  • 63
  • 222
  • 338
  • i have replaced the file on windows but id doesn't help because the file is reset every time i re-open the project in IDE – Cubius Nov 17 '12 at 16:29
  • i have the same problem, this solution does not work in windows – user1437481 Nov 17 '12 at 19:18
  • Guys, maybe you had a different problem than I did. But this worked in my case thou I am not sure if IDEA pulled content from default or personal XML file – sandalone Nov 19 '12 at 10:08
  • Do you have access to Linux machine? Try pulling XML file from Linux SDK. I did reverse thing and it worked - pulled XML from windows machine and pasted it into Linux. – sandalone Nov 19 '12 at 10:09
8

Insert in the file %USER%\.android\devices.xml data from a previous version of SDK. For example, below:

    <?xml version="1.0"?>
<d:layout-devices
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:d="http://schemas.android.com/sdk/android/layout-devices/1">

    <d:device name="2.7in QVGA">
        <d:default>
            <d:screen-size>small</d:screen-size>
            <d:screen-ratio>notlong</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>ldpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>240</d:size>
                <d:size>320</d:size>
            </d:screen-dimension>
            <d:xdpi>145</d:xdpi>
            <d:ydpi>145</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="2.7in QVGA slider">
        <d:default>
            <d:screen-size>small</d:screen-size>
            <d:screen-ratio>notlong</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>ldpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:text-input-method>qwerty</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>240</d:size>
                <d:size>320</d:size>
            </d:screen-dimension>
            <d:xdpi>145</d:xdpi>
            <d:ydpi>145</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape, closed">
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
        <d:config name="Landscape, open">
            <d:keyboard-state>keysexposed</d:keyboard-state>
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="3.2in HVGA slider (ADP1)">
        <d:default>
            <d:screen-size>normal</d:screen-size>
            <d:screen-ratio>notlong</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>mdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:text-input-method>qwerty</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>trackball</d:nav-method>
            <d:screen-dimension>
                <d:size>320</d:size>
                <d:size>480</d:size>
            </d:screen-dimension>
            <d:xdpi>180.6</d:xdpi>
            <d:ydpi>182</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape, closed">
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
        <d:config name="Landscape, open">
            <d:keyboard-state>keysexposed</d:keyboard-state>
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="3.2in HVGA (ADP2)">
        <d:default>
            <d:screen-size>normal</d:screen-size>
            <d:screen-ratio>notlong</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>mdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>trackball</d:nav-method>
            <d:screen-dimension>
                <d:size>320</d:size>
                <d:size>480</d:size>
            </d:screen-dimension>
            <d:xdpi>180.6</d:xdpi>
            <d:ydpi>182</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="3.3in WQVGA">
        <d:default>
            <d:screen-size>normal</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>ldpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>240</d:size>
                <d:size>400</d:size>
            </d:screen-dimension>
            <d:xdpi>141</d:xdpi>
            <d:ydpi>141</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>
    <d:device name="3.4in FWQVGA">
        <d:default>
            <d:screen-size>normal</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>ldpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>240</d:size>
                <d:size>432</d:size>
            </d:screen-dimension>
            <d:xdpi>145</d:xdpi>
            <d:ydpi>145</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="3.7in WVGA (Nexus One)">
        <d:default>
            <d:screen-size>normal</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>hdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>trackball</d:nav-method>
            <d:screen-dimension>
                <d:size>480</d:size>
                <d:size>800</d:size>
            </d:screen-dimension>
            <d:xdpi>254</d:xdpi>
            <d:ydpi>254</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="3.7in FWVGA slider">
        <d:default>
            <d:screen-size>normal</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>hdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:text-input-method>qwerty</d:text-input-method>
            <d:nav-state>navhidden</d:nav-state>
            <d:nav-method>dpad</d:nav-method>
            <d:screen-dimension>
                <d:size>480</d:size>
                <d:size>854</d:size>
            </d:screen-dimension>
            <d:xdpi>265</d:xdpi>
            <d:ydpi>265</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape, closed">
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
        <d:config name="Landscape, open">
            <d:keyboard-state>keysexposed</d:keyboard-state>
            <d:screen-orientation>land</d:screen-orientation>
            <d:nav-state>navexposed</d:nav-state>
        </d:config>
    </d:device>

    <d:device name="4in WVGA (Nexus S)">
        <d:default>
            <d:screen-size>normal</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>hdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>480</d:size>
                <d:size>800</d:size>
            </d:screen-dimension>
            <d:xdpi>235</d:xdpi>
            <d:ydpi>235</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="4.65in 720p (Galaxy Nexus)">
        <d:default>
            <d:screen-size>normal</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>xhdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>720</d:size>
                <d:size>1280</d:size>
            </d:screen-dimension>
            <d:xdpi>316</d:xdpi>
            <d:ydpi>316</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="4.7in WXGA">
        <d:default>
            <d:screen-size>normal</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>xhdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>1280</d:size>
                <d:size>720</d:size>
            </d:screen-dimension>
            <d:xdpi>320</d:xdpi>
            <d:ydpi>320</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="5.1in WVGA">
        <d:default>
            <d:screen-size>large</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>mdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>480</d:size>
                <d:size>800</d:size>
            </d:screen-dimension>
            <d:xdpi>183</d:xdpi>
            <d:ydpi>183</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="5.4in FWVGA">
        <d:default>
            <d:screen-size>large</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>port</d:screen-orientation>
            <d:pixel-density>mdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>480</d:size>
                <d:size>854</d:size>
            </d:screen-dimension>
            <d:xdpi>181</d:xdpi>
            <d:ydpi>181</d:ydpi>
        </d:default>

        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="7in WSVGA (Tablet)">
        <d:default>
            <d:screen-size>large</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>land</d:screen-orientation>
            <d:pixel-density>mdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>1024</d:size>
                <d:size>600</d:size>
            </d:screen-dimension>
            <d:xdpi>169</d:xdpi>
            <d:ydpi>169</d:ydpi>
        </d:default>

        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="7in WXGA (Nexus 7)">
        <d:default>
            <d:screen-size>large</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>land</d:screen-orientation>
            <d:pixel-density>tvdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>1280</d:size>
                <d:size>800</d:size>
            </d:screen-dimension>
            <d:xdpi>195</d:xdpi>
            <d:ydpi>200</d:ydpi>
        </d:default>

        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
    </d:device>

    <d:device name="10.1in WXGA (Tablet)">
        <d:default>
            <d:screen-size>xlarge</d:screen-size>
            <d:screen-ratio>long</d:screen-ratio>
            <d:screen-orientation>land</d:screen-orientation>
            <d:pixel-density>mdpi</d:pixel-density>
            <d:touch-type>finger</d:touch-type>
            <d:keyboard-state>keyssoft</d:keyboard-state>
            <d:text-input-method>nokeys</d:text-input-method>
            <d:nav-state>navexposed</d:nav-state>
            <d:nav-method>nonav</d:nav-method>
            <d:screen-dimension>
                <d:size>1280</d:size>
                <d:size>800</d:size>
            </d:screen-dimension>
            <d:xdpi>149</d:xdpi>
            <d:ydpi>149</d:ydpi>
        </d:default>

        <d:config name="Landscape">
            <d:screen-orientation>land</d:screen-orientation>
        </d:config>
        <d:config name="Portrait">
            <d:screen-orientation>port</d:screen-orientation>
        </d:config>
    </d:device>
</d:layout-devices>
Kris
  • 101
  • 3
  • This solved this issue for me after updating to the latest SDK tools 21. In the version 21 Google has changed the devices.xml format, so I copied your version to the "home" directory and it works again. I am on Windows. – shelll Nov 19 '12 at 14:58
  • Copying this file worked for us (on Windows), except that we had to replace the file in the SDK/tools/lib/devices.xml directory. Putting it in the home directory didn't work for some reason. – Brian Slesinsky Nov 29 '12 at 07:14
0

same in my case. this problem were appears when I update ADT. I guess problem is there...

Paul Fleming
  • 24,238
  • 8
  • 76
  • 113
  • I updated android sdk also but problem what I see is in devices.xml in .android and sdk_home/tools/lib ... devices.xml in .android using different schema as other stored in sdk_home ... – user1740586 Nov 19 '12 at 01:13
  • 1
    the problem with the new SDK is that they chenged the devices.xml format so the default devices are not loaded. I used the xml provided by Kris (and put it in the folder Kris told) and now I can see all the devices again :) – shelll Nov 19 '12 at 14:56