简体   繁体   中英

Eclipse Layout Designer cannot open IntelliJ-created XML file

After realizing why Eclipse did not want to open XMl files in its Layout designer, I hope we'll be able to solve this issue here.

Anyway, after I create the project in InteliJ IDEA, exports it in Eclipse format, opens it in Eclipse, I realize that Eclipse Layout Designer does not recognize such XML file and the Layout Designer cannot load its content into right pane of the designer. This is how the Designer looks like after I try to load InteliJ-created XML file.

Indeed, I can load Android layout elements after setting Designer to correct Android OS version (dropdown list, elements appear in left pane of the designer), but the very content of the XML file gets never loaded in the right pane of the Designer.

After examining the STRUCTURE of a project created in Eclipse and a project created in IntelliJ, I realized that Eclipse DOES NOT generate Java files in /gen directory nor it imports correct Android library once I import IntelliJ-created project. Look at the image.

The upper project is created in Eclipse and it has both Android R files and Android library imported. The project below is created in IntelliJ, exported to Eclipse format and then imported into Eclipse workspace. It does not have either Android R files or Android library imported.

Another problem is that I cannot force rebuild the Intellij-created project or even clean it in Eclipse because it isn't in the list of projects. Like Eclipse does not see it as an Android project at all.

The final issue is: when I manually set Android OS version in Layout Designer, then try to grab&drop Android element into the right pane of the Designer, I get the message (error) "Missing project resources". Look at the image.

Please help!

I've not used IntelliJ IDEA for Android development. But from what I can guess I think there is an encoding mismatch. The text files are typically encoded in UTF-8. But some editors have a different default encoding like: ISO-8859-1. This could be confusing IntelliJ parser.

If the encoding is OK, check whether IntelliJ is trying to validate the xml file against Android schema. If it can't find the schema then the IDE should report the error on the logs. You can either turn off validation or show the schema path to IntelliJ.

If you don't mind me asking, why do you want to use IntelliJ instead of Eclipse?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM