Fixed
Status Update
Comments
rf...@gmail.com <rf...@gmail.com> #2
any solution for windows?copying the devices.xml does not seem to be enough
tn...@google.com <tn...@google.com> #3
Is IntelliJ using the devices.xml file we added in ADT 21 to keep device definitions, or is that file something IntelliJ added and just by random chance happens to conflict with a new file we added in 21?
vs...@google.com <vs...@google.com> #4
In any case, IntelliJ shouldn't be saving metadata under .android.
[Deleted User] <[Deleted User]> #5
I admit, I am a bit confused now...
Let me explain how it used to work before ADT 21:
- create a new device definition in Eclipse (ADT <= 20)
- open IntelliJ and open an Android project
- open a layout xml in the preview
- select a device
=> preview offers the same definitions as Eclipse, including the custom one just created
...so I assumed both ADT <= 20 and IntelliJ were using the same mechanism to store those definitons.
I can also use IntelliJ to add a device definition, and doing so adds them to .android/devices.xml (creating that file if absent).
I have attached a working devices.xml as IntellJ would use.
As for ADT 21, you wrote you added the file device.xml for that release and did not use it before. However, as far as I can tell, ADT 21 does even offer a way to create device defitions. To me it appears it is just using a predefined set and you cannot add any additional ones.
If that possibility is still there in ADT 21, could you please tell me where to find it?
Let me explain how it used to work before ADT 21:
- create a new device definition in Eclipse (ADT <= 20)
- open IntelliJ and open an Android project
- open a layout xml in the preview
- select a device
=> preview offers the same definitions as Eclipse, including the custom one just created
...so I assumed both ADT <= 20 and IntelliJ were using the same mechanism to store those definitons.
I can also use IntelliJ to add a device definition, and doing so adds them to .android/devices.xml (creating that file if absent).
I have attached a working devices.xml as IntellJ would use.
As for ADT 21, you wrote you added the file device.xml for that release and did not use it before. However, as far as I can tell, ADT 21 does even offer a way to create device defitions. To me it appears it is just using a predefined set and you cannot add any additional ones.
If that possibility is still there in ADT 21, could you please tell me where to find it?
vs...@google.com <vs...@google.com> #6
You can add devices by opening AVD Manager, click on Device Definitions tab. The user devices created there are stored in .android/devices.xml
At first glance, it looks like IntelliJ is using the same library to create devices. I'm not sure why it would be deleted. Maybe you could try creating a device with IntelliJ and one with the AVD Manager and see if there are any differences in the device.xml file in case this is a format issue.
At first glance, it looks like IntelliJ is using the same library to create devices. I'm not sure why it would be deleted. Maybe you could try creating a device with IntelliJ and one with the AVD Manager and see if there are any differences in the device.xml file in case this is a format issue.
[Deleted User] <[Deleted User]> #7
I just checked this on a Mac where I haven't yet updated to the new SDK and which also does _not_ have IntelliJ installed:
- check files in $HOME/.android:
=> devices.xml absent
- start Eclipse
- create Android project
- open layout xml
- create new custom device config and close all dialogs with OK
- check files in $HOME/.android:
=> devices.xml is now present and contains the new custom definition
So clearly IntelliJ is just using the same file as ADT used to do (which makes sense, if you ask me, so you have the same definitions available in both Eclipse and IntelliJ).
- check files in $HOME/.android:
=> devices.xml absent
- start Eclipse
- create Android project
- open layout xml
- create new custom device config and close all dialogs with OK
- check files in $HOME/.android:
=> devices.xml is now present and contains the new custom definition
So clearly IntelliJ is just using the same file as ADT used to do (which makes sense, if you ask me, so you have the same definitions available in both Eclipse and IntelliJ).
[Deleted User] <[Deleted User]> #8
I compared the devices.xml from the AVD manager and the old ADT/IntelliJ and indeed they are very much different - just compare the first couple of lines:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<d:devices xmlns:d="http://schemas.android.com/sdk/devices/1 " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance ">
<d:device>
vs.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<d:layout-devices xmlns:d="http://schemas.android.com/sdk/android/layout-devices/1 ">
<d:device name="MyDevice">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<d:devices xmlns:d="
<d:device>
vs.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<d:layout-devices xmlns:d="
<d:device name="MyDevice">
[Deleted User] <[Deleted User]> #9
attached a devices.xml created with AVD Manager
[Deleted User] <[Deleted User]> #10
tn...@google.com <tn...@google.com> #11
Apparently the device manager will delete the devices.xml file if it cannot parse it in order to restore the default set of devices. If there's a name conflict here and IntelliJ writes an unrelated file called devices.xml into ~/.android/ then it's possible it gets deleted in that way.
jl...@gmail.com <jl...@gmail.com> #12
No, AVD Manager doesnt remove the file devices.xml. This file is renamed like "devices.xml.old" when the structure to the xml file is wrong. The format of numeric values isnt correct, the decimal separator should be a dot instead of comma.
It's an AVD Manager bug.
It's an AVD Manager bug.
tn...@google.com <tn...@google.com> #13
I think there are two separate bugs here.
There is for sure a bug in locale handling of floats; I submitted a fix for that last week, and I've backported it to 21.0.1. However, it sounds like there's also something going on with IntelliJ; the author of the device class said on adt-dev that it will ignore the contents if it can't parse it (https://groups.google.com/d/msg/adt-dev/nfJvhxO8iJk/hMsHV3xNN34J ) and comment 6 above shows that the contents are pretty different. So that issue might still be there after the fix, but at least the locale bug should be fixed in 21.0.1 with
https://android-review.googlesource.com/#/c/46679/
If there's a separate issue with IntelliJ can somebody verify and file a new issue after testing with 21.0.1 to separate it from the locale issue?
There is for sure a bug in locale handling of floats; I submitted a fix for that last week, and I've backported it to 21.0.1. However, it sounds like there's also something going on with IntelliJ; the author of the device class said on adt-dev that it will ignore the contents if it can't parse it (
If there's a separate issue with IntelliJ can somebody verify and file a new issue after testing with 21.0.1 to separate it from the locale issue?
[Deleted User] <[Deleted User]> #14
FYI, using the combination of IntelliJ 12 (release) with the 21.0.1 rc1 tools from the preview channel works fine (i.e. both issues related to devices.xml are gone).
am...@gmail.com <am...@gmail.com> #15
You can add devices by opening AVD Manager, click on Device Definitions tab. The user devices created there are stored in .android/devices.xml
do it herehttp://pastebin.com/FrrZEUbp
do it here
tn...@google.com <tn...@google.com> #16
Released a while back.
ke...@gmail.com <ke...@gmail.com> #17
This is still happening for me. I made an emulator using Android Studio and it made a devices.xml in <user>/.android. This was usable both with the AVD Manager in Android Studio and the SDK one you get via "android.bat avd". However, when I started Eclipse, it found an error parsing this devices.xml and renamed it to devices.xml.old. After that the emulator showed as broken (no device) in both AVD Managers, and the emulator I created was not available for running in Eclipse.
It appears Eclipse rejects devices.xml because it doesn't comply with it's XSD, not because it is not usable. Apparently the others don't check and use it (successfully) anyway.
I had to make two changes to make mine parse correctly in Eclipse (and to work for running apps).
I changed 400dpi to xxhdpi in
<d:pixel-density>400dpi</d:pixel-density>
and I deleted lines like:
<d:skin>C:/Android/platforms/android-19/skins/GalaxyS5</d:skin>
These are apparently not allowed by the XSD.
Note that this is what worked for me. In general the problem seems to be that Android Studio is writing devices.xml files that are invalid for the specified XSD, and Eclipse is renaming the file, so it doesn't work, when it doesn't parse correctly.
It appears Eclipse rejects devices.xml because it doesn't comply with it's XSD, not because it is not usable. Apparently the others don't check and use it (successfully) anyway.
I had to make two changes to make mine parse correctly in Eclipse (and to work for running apps).
I changed 400dpi to xxhdpi in
<d:pixel-density>400dpi</d:pixel-density>
and I deleted lines like:
<d:skin>C:/Android/platforms/android-19/skins/GalaxyS5</d:skin>
These are apparently not allowed by the XSD.
Note that this is what worked for me. In general the problem seems to be that Android Studio is writing devices.xml files that are invalid for the specified XSD, and Eclipse is renaming the file, so it doesn't work, when it doesn't parse correctly.
de...@gmail.com <de...@gmail.com> #18
I'm getting the same bug, as well. Most recent version of Android Studio, not using Eclipse at all. Just using Android Studio and its built-in AVD Manager.
zi...@gmail.com <zi...@gmail.com> #19
Same problem with 280dpi and Android Studio 1.2.2.
With <d:pixel-density>280dpi</d:pixel-density> AVD Manager/Android Studio renames devices.xml to .old; if I change manually in the xml file 280dpi to 400dpi, all works OK.
Please, check the parser and fix it.
With <d:pixel-density>280dpi</d:pixel-density> AVD Manager/Android Studio renames devices.xml to .old; if I change manually in the xml file 280dpi to 400dpi, all works OK.
Please, check the parser and fix it.
Description
applicable)
Host OS: Ubuntu Lucid
SDK tools version (available in the "About" section of the 'android' tool
UI): 21
Eclipse version: Juno SR 1 Build ID 20121004-1855
ADT plug-in version: 21.0.0.v201210310015-519525
STEPS TO REPRODUCE:
1. ensure you have the file devices.xml in $HOME/.android with some device layouts configured
2. start Eclipse and open an Android project
3. open a layout XML in the layout editor
EXPECTED RESULTS:
the file $HOME/.android/devices.xml is kept
OBSERVED RESULTS:
the file $HOME/.android/devices.xml is deleted
ADDITIONAL INFORMATION:
The Android layout preview of IntelliJ IDEA 11 relies on the file $HOME/.android/devices.xml .
So basically since the JellyBean 4.2 ADT update opening a layout file in Eclipse now breaks the layout preview in IntelliJ.
As a workaround I have to back-up devices.xml and copy it back each time the Eclipse ADT layout edtior deleted it.